Algorithms, Dynamic Programming, Data Structures, Computer Science, Leetcode.
were able to solve this problem with O(n) time complexity. Let’s take a look at how it works. The value of toy(target) is only related to the values of toy(target-1), toy(target-5), and toy(target-11), and we only care about the value of toy(target), not how to make up the target. These two facts