Skip to content

Commit 64aa6d9

Browse files
committed
fix solution: logic error fix
1 parent 1a555d6 commit 64aa6d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

climbing-stairs/dusunax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def climbStairsLoop(self, n: int) -> int:
4545

4646
# SC: O(1)
4747
prev2 = 1 # ways to step 0
48-
prev1 = 1 # ways to step 1
48+
prev1 = 2 # ways to step 1
4949

5050
for i in range(3, n + 1): # TC: O(n)
5151
current = prev1 + prev2 # ways to (n-1) + (n-2)

0 commit comments

Comments
 (0)