We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a555d6 commit 64aa6d9Copy full SHA for 64aa6d9
climbing-stairs/dusunax.py
@@ -45,7 +45,7 @@ def climbStairsLoop(self, n: int) -> int:
45
46
# SC: O(1)
47
prev2 = 1 # ways to step 0
48
- prev1 = 1 # ways to step 1
+ prev1 = 2 # ways to step 1
49
50
for i in range(3, n + 1): # TC: O(n)
51
current = prev1 + prev2 # ways to (n-1) + (n-2)
0 commit comments