3 ms·
I'm being nitpicky, but the iterative and "dynamic programming" solution are both dynamic programming if you follow the strict definition. Both are exploiting
by jchonphoenix 15y ago
I'm being nitpicky, but the iterative and "dynamic programming" solution are both dynamic programming if you follow the strict definition.
Both are exploiting optimal substructure and the recursive nature of the problem. The best solution, labeled as "dynamic programming" in this article is actually just the most well optimized dp solution.
- jakubw 15y agoWhile we're at it, the last one could work purely in-place.