Infosys interview question

medium level leetcode questions including dynamic programming