Infosys interview question

greedy algorithm, dynamic programming, Array, Strings, List