This is yet another problem from the leetcode's recent biweekly challenge.
It's very common in the competitions to have one problem which is based on dynamic programming. How intuitive is DP for you ?
Watch me explain how can we build the mindset by first understanding the recursive state and try to memoize it.
Though the recursive approach are bit slower as compared to the iterative ones, but implementing the recurrence relation in the iterative approach can be bit tricky.
Please let me know in the comment if you have any suggestions are feedback for me.
Check my playlist for other similar problems,
[ Ссылка ]
problem link == [ Ссылка ]
And please do subscribe to my channel if you like my work.
Thanks.
Ещё видео!