You are viewing a single comment's thread. Return to all comments →
Interesting. I implemented both - dynamic and this solution and found that performance is about the same, but it varies - in some cases dynamic solution is better, while in others your solution is.
Can you please explain how you applied dynamic programming method.
do you mind explaining your DP? I don't understand how DP can beat this linear solution.