Skip to content

Commit e0ca86a

Browse files
fix(curriculum): clarify DP function calls vs unique subproblems (freeCodeCamp#65749)
1 parent 4fa56fb commit e0ca86a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

curriculum/challenges/english/blocks/lecture-understanding-dynamic-programming/68420c7fb5b9e36eefb9e98f.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ This implementation has exponential time complexity because of massive redundant
4646
- `climb_stairs(2)` gets calculated **3 times total**
4747

4848

49-
For just `n=5`, we make 9 function calls when we only need 5 unique calculations. As `n` grows, this redundancy explodes exponentially - `climb_stairs(30)` would require over 1 billion function calls! The time complexity becomes `O(2^n)`, making it inefficient and impractical for larger values of `n`.
49+
For just `n=5`, we make 9 function calls when we only need 5 unique calculations. As `n` grows, this redundancy explodes exponentially - `climb_stairs(30)` would require a few million function calls. The time complexity becomes `O(2^n)`, making it inefficient and impractical for larger values of `n`.
5050

5151
## Dynamic Programming Solutions
5252

@@ -113,7 +113,7 @@ Call: climb_stairs_memo(5)
113113

114114
- **Space complexity**: `O(n)` for the memo storage and call stack
115115

116-
- **Real impact**: `climb_stairs(30)` drops from 1+ billion calls to just 30 calls!
116+
- **Real impact**: `climb_stairs(30)` drops from millions of function calls to about 30 unique subproblem calculations
117117

118118

119119
### Tabulation (Bottom-Up Approach)

0 commit comments

Comments
 (0)