Counting change using greedy algorithm