Amazon interview question

Technical question was Greedy minimization problem