Meta interview question

Greedy algorithm question