출처 : https://leetcode.com/problems/climbing-stairs/
You are climbing a staircase. It takes n steps to reach the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

class Solution {
public int climbStairs(int n) {
int[] memo = new int[46];
memo[1] = 1;
memo[2] = 2;
int count = 3;
while (count <= n) {
memo[count] = memo[count - 1] + memo[count - 2];
count++;
}
return memo[n];
}
}
💫 Memoization (DP) 활용