Domanda di colloquio di Amazon

Technical question was Greedy minimization problem