← Climbing Stairs
Discussions
Sign in to join the discussion.
L
likhithaheg1
OFFICIAL
1 month ago
Clean Python solution, beats most submissions.
Define dp[i] as the answer for the first i elements and write the transition from smaller states. Once it works, notice you only need the previous row/value, so space drops to O(1) or O(n).
💬 0 replies
J
jahnavisub6
1 month ago
Finally got AC after 3 WAs. Sharing what I missed.
Define dp[i] as the answer for the first i elements and write the transition from smaller states. Once it works, notice you only need the previous row/value, so space drops to O(1) or O(n).
💬 3 replies
A
aditimenon
1 month, 3 weeks ago
Finally got AC after 3 WAs. Sharing what I missed.
Define dp[i] as the answer for the first i elements and write the transition from smaller states. Once it works, notice you only need the previous row/value, so space drops to O(1) or O(n).
💬 0 replies