Infosys Interview Question

A question based on dynamic programming