Algorithms, Dynamic Programming, Data Structures, Computer Science, Leetcode.
denominations of the bills we carry are not 1, 5, 10, 50, 100, the greedy strategy may not work. If we carry 1, 5, and 11 bills(assuming there is a country in the world whose banknotes have a face value of 11), the greedy strategy will fail when we need to buy a toy that costs 15, because 15 = 1 ×