One Pager Cheat Sheet
- This lesson will help you demystify and learn the skill of 
Dynamic Programmingby walking through examples and providing a system to help solve most problems. Dynamic Programminghelps us save time by remembering information.- Using the 
FASTmethod can help us break down complex problems into smaller subproblems, such as calculating thenth Fibonacci number. - The Fibonacci sequence is a recursive formula where each number is the sum of the previous 
2numbers. - We need to 
find the brute force solutionfor the nth Fibonacci number as the first step of the FAST method before we can optimize it. - Our solution uses Dynamic Programming because it has both overlapping subproblems and an optimal substructure.
 - We identify the subproblems as 
fib(n-1)andfib(n-2)in order tomemoizethem and save results. - We are creating a 
cacheto store already computed solutions and returning them if they exist, leading to a time complexity ofO(n)and a space complexity ofO(n). - We will 
iterativelybuild from the base case andwork our way upto solve the problem. - The bottom-up solution has an 
O(n)time and space complexity, while being easier to understand and more intuitive than the top-down solution. - Dynamic programming is an algorithm that solves complex problems by breaking them down into smaller subproblems and combining the solutions to obtain the optimal results, and it can be done either via a top-down or bottom-up 
approach. - The FAST method of dynamic programming 
trades offthetime complexityof the algorithm forincreased space complexityby allocating additional space to store data, thereby reducing the amount of time required to solve the problem. - By using a bottom-up approach to consider how much money can be made 
robbing 0 to n houses, theHouse Robberproblem can be solved to find the maximum amount of money that robbers can make. - We would 
robonlyone houseand take what it has. If house A has more money, we rob house A; otherwise, we rob house B.- The 
bottom-up (iterative)process of dynamic programming can be utilized to solve for thenthanswer by solving smaller subproblems for theithanswer. - The code 
put togetherwould look likethis. - The 
bottom-upapproach of solving simpler cases and building an arrayarrto store the max amount of money we can rob up to and including the current house ultimately allows us to find the maximum amount of money that can be robbed. - Dynamic programming allows for problems to be broken down into smaller subproblems and solutions from these subproblems to be 
storedand used to solve the larger problem, allowing for solutions without the need for knowledge of previous and current states, such as calculating the maximum amount of money we can rob for each house. - With 
FASTand enough practice, Dynamic Programming can be used to reach an optimal solution. - Using dynamic programming, the problem can be solved by initializing an array, looping from 0 to 
n, adding the base case, and filling the array using the recursive formula. 


