From e0ca86a0208b7e520e187c32fc71efded6fcc46f Mon Sep 17 00:00:00 2001 From: Jeevankumar S <110320697+Jeevankumar-s@users.noreply.github.com> Date: Tue, 3 Mar 2026 03:50:28 +0530 Subject: [PATCH] fix(curriculum): clarify DP function calls vs unique subproblems (#65749) --- .../68420c7fb5b9e36eefb9e98f.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/blocks/lecture-understanding-dynamic-programming/68420c7fb5b9e36eefb9e98f.md b/curriculum/challenges/english/blocks/lecture-understanding-dynamic-programming/68420c7fb5b9e36eefb9e98f.md index 66ce39c5876..f89f1496c3e 100644 --- a/curriculum/challenges/english/blocks/lecture-understanding-dynamic-programming/68420c7fb5b9e36eefb9e98f.md +++ b/curriculum/challenges/english/blocks/lecture-understanding-dynamic-programming/68420c7fb5b9e36eefb9e98f.md @@ -46,7 +46,7 @@ This implementation has exponential time complexity because of massive redundant - `climb_stairs(2)` gets calculated **3 times total** -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`. +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`. ## Dynamic Programming Solutions @@ -113,7 +113,7 @@ Call: climb_stairs_memo(5) - **Space complexity**: `O(n)` for the memo storage and call stack -- **Real impact**: `climb_stairs(30)` drops from 1+ billion calls to just 30 calls! +- **Real impact**: `climb_stairs(30)` drops from millions of function calls to about 30 unique subproblem calculations ### Tabulation (Bottom-Up Approach)