greedy algorithm

Not necessarily, when it comes to money.