Algorithms, Dynamic Programming, Data Structures, Computer Science, Leetcode.
assuming the initial situation is “ price = target”, the greedy strategy will quickly make target smaller. Try to reduce target by 100 as much as possible, so the next situation is “price = target-100”. In many cases, the greedy strategy is correct. Shortcomings of Greedy Algorithm However, if the