Nykaa Interview Question

Dynamic Programming basic easy problem.