Amazon Interview Question

Technical question was Greedy minimization problem