Infosys interview question

coding questions based on dynamic programming