Dynamic Programming https://www.geeksforgeeks.org/knuths-optimization-in-dynamic-programming/
Knuth’s Optimization
Knuth’s optimization is a very powerful tool in dynamic programming, that can be used to reduce the time complexity of the solutions primarily from to .
The cost function must be a monotonic function?
The key is this following inequality: