Infosys Interview Question

arrays. need to use dynamic programming techniques