Amazon interview question

Greedy and Dynamic Programming DSA questions