Skip to content

Commit 6860f50

Browse files
authored
Update readme.md
1 parent 2c96f62 commit 6860f50

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Climbing_Stairs/readme.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Climbing Stairs Problem
22

3+
## Problem Description:
4+
5+
You are climbing a staircase. It takes `n` steps to reach the top.
6+
7+
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
8+
9+
### Example 1:
10+
- **Input:** n = 2
11+
- **Output:** 2
12+
- **Explanation:** There are two ways to climb to the top.
13+
1. 1 step + 1 step
14+
2. 2 steps
15+
16+
### Example 2:
17+
- **Input:** n = 3
18+
- **Output:** 3
19+
- **Explanation:** There are three ways to climb to the top.
20+
1. 1 step + 1 step + 1 step
21+
2. 1 step + 2 steps
22+
3. 2 steps + 1 step
23+
24+
### Constraints:
25+
- 1 <= n <= 45
26+
327
## Problem Understanding:
428

529
In problems like the Climbing Stairs problem, I begin by creating a few test cases to identify the pattern and relationship between the steps.

0 commit comments

Comments
 (0)