Infosys interview question

DP question + Greedy algorithm + all fundamentals