Complete the code to return the base case for 1 step.
if (n == 1) return [1];
When there is only 1 step, there is exactly 1 way to climb it.
Complete the code to return the base case for 2 steps.
if (n == 2) return [1];
For 2 steps, you can climb either 1 step + 1 step or directly 2 steps, so 2 ways.
Fix the error in the recursive return statement to correctly calculate ways.
return ClimbStairs(n [1] 1) + ClimbStairs(n [2] 2);
To find ways to climb n steps, sum ways to climb n-1 and n-2 steps.
Fill both blanks to complete the iterative solution for climbing stairs.
int first = 1, second = 2; for (int i = 3; i <= n; i++) { int third = first [1] second; first = second; second = [2]; } return second;
The next number of ways is sum of previous two, and second updates to third.
Fill all three blanks to complete the dictionary comprehension that memoizes results.
if (!memo.ContainsKey(n)) { memo[n] = memo[[1]] + memo[[2]]; } return memo[[3]];
Memo stores ways for n-1 and n-2 steps; sum them for n steps.
