First Dynamic Programming Problem From LeetCode

When I first encountered this problem I was not familiar with dynamic programming. What I learned was that dynamic programming is a powerful technique that reduces the redundancies of recursive strategies.

What is Dynamic Programming?

Dynamic programming breaks down the problem into smaller and yet smaller possible sub-problems. These sub-problems are not solved independently. Instead, results of these smaller sub-problems are remembered and used for similar or overlapping sub-problems.

We use dynamic programming when we have problems that can be divided in smaller sub problems so that those results can be reused.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store