Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 666 Bytes

dynamic-programming.md

File metadata and controls

11 lines (7 loc) · 666 Bytes

Dynamic Programming

{% hint style="info" %} Dynamic programming is a method for solving problems by breaking them down into smaller subproblems and storing the solutions to these subproblems for later use. {% endhint %}

The key idea behind dynamic programming is to avoid solving the same subproblems multiple times by storing their solutions in a table or array. This allows us to reuse these solutions later when solving larger subproblems or the original problem.

Here, we use a loop tp compute the solutions to larger subproblems using the solutions to smaller subproblems.

{% embed url="https://gist.github.com/Aisuko/74ee0cc19ea7adbd545bc89756a3616a" %}