Algorithms, Dynamic Programming, Data Structures, Computer Science, Leetcode.
strategy: use bills with larger denominations as much as possible. If 100 can be used, use it, otherwise, try to use 50… and so on. For example, if the cost of the toy is 666, then 666 = 6 × 100 + 1 × 50 + 1 × 10 + 1 × 5 + 1 × 1, using a total of 10 bills. In fact, this strategy is called “greedy”: