Algorithms, Dynamic Programming, Data Structures, Computer Science, Leetcode.
11 + 4 × 1 (the greedy strategy uses 5 bills), while the correct strategy is 15 = 3 × 5 (using only 3 bills). What is wrong with the greedy strategy? Root cause of the problem The root cause is shortsightedness. As mentioned earlier, the idea behind the greedy strategy is to “make the next target