Google Interview Question

Leet code hard DSA question about dynamic programming