You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: C#/Climbing Stairs/readme.md
+7-9
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# Solution Approach
2
2
3
-
## The ClimbStairs class in Solution.cs implements a recursive method SolveRecursive to calculate the number of ways to climb the stairs. To optimize the performance and avoid redundant calculations, memoization is used.
4
-
Key Features
3
+
The ClimbStairs class in Solution.cs implements a recursive method SolveRecursive to calculate the number of ways to climb the stairs. To optimize the performance and avoid redundant calculations, memoization is used.
4
+
## Key Features
5
5
6
-
### Recursion:
7
-
The solution uses a recursive approach, breaking down the problem into smaller, manageable sub-problems.
8
-
### Memoization:
9
-
To prevent repetitive calculations for the same number of steps, we utilize an array climbStairsMemo for storing intermediate results. This significantly reduces the time complexity from exponential to linear.
6
+
- Recursion:
7
+
The solution uses a recursive approach, breaking down the problem into smaller, manageable sub-problems.
8
+
- Memoization:
9
+
To prevent repetitive calculations for the same number of steps, we utilize an array climbStairsMemo for storing intermediate results. This significantly reduces the time complexity from exponential to linear.
10
10
11
11
12
12
## Problem Description:
@@ -35,6 +35,4 @@ Explanation: There are three ways to climb to the top.
0 commit comments