Dynamic programming: core concepts
medium 18 minDynamic programming solves a problem by breaking it into smaller subproblems, solving each distinct subproblem once and storing the answer.
One problem, four ways: brute force, memo, table, rolling
Read it, run it, change a line and run it again.
Loading editor…
Min cost climbing: each step has a cost you pay when you leave it, you climb 1 or 2 steps at a time and may start on step 0 or 1. All four functions return the same answer; only the first is exponential.