āš ļø Blockly failed to load. Check your internet connection and refresh.
Staircase Climbing
Problem
A staircase has N steps. You start at the bottom (step 0).

Each move, you can climb 1 step or 2 steps.

In how many different ways can you reach step N?
🧠 DP Concept
This is a Dynamic Programming problem. You need a dp table — an array where dp[i] stores the number of ways to reach step i.

Use set dp[i] to store values and get dp[i] to read them back.

Base cases: dp[0] = 1 (one way to be at the bottom: do nothing), dp[1] = 1.
Recurrence: dp[i] = dp[iāˆ’1] + dp[iāˆ’2] (you arrived from one step below or two steps below).
Input Variables (pre-loaded)
šŸ’” Drag N, set dp[i], and get dp[i] from the toolbox.
Your Output
Result
—
Run your program to see the result.
Execution Log
Ready. Press ā–¶ Run to start.
Expected Answer
Answer:
?
Hint