What is the thinking process behind this DP solution?
Apart from the algorithm which has been explained in the video, I want to know the logical thinking process which explains why this particular solution was used for this problem and why not some other solution.
For eg: you can tell about the very naive solution which comes to mind and then how you think about optimizing it which might lead to this DP solution.