Skip to content

Commit acf6130

Browse files
NTIRINTIS IOANNIS-PANAGIOTISNTIRINTIS IOANNIS-PANAGIOTIS
NTIRINTIS IOANNIS-PANAGIOTIS
authored and
NTIRINTIS IOANNIS-PANAGIOTIS
committed
2 parents b7a291e + 4799053 commit acf6130

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

C#/Climbing Stairs/readme.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Solution Approach
22

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
55

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.
1010

1111

1212
## Problem Description:
@@ -35,6 +35,4 @@ Explanation: There are three ways to climb to the top.
3535

3636

3737
Constraints:
38-
39-
1 <= n <= 45
40-
38+
1 <= n <= 45

0 commit comments

Comments
 (0)