Infosys interview question

arrays. need to use dynamic programming techniques