File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
- # Climbing Stairs Problem
1
+ # Plus One Problem
2
2
3
3
## Problem Description:
4
4
@@ -50,15 +50,15 @@ However, the third example introduces a **carry-over** situation when the sum ex
50
50
51
51
Thinking simply often leads to faster solutions 😊
52
52
53
- ## Climbing Stairs Problem - Case Breakdown
53
+ ## Plus One Problem - Case Breakdown
54
54
55
55
Let's try with ` [1,5,6,9] `
56
56
57
- reverse it -> ` 9651 `
58
- add the carry to firs digit -> ` 9 + 1 = 10 `
59
- Check for carry-over ->Since 10 creates a carry ` (10 == 10) ` , we continue propagating it.
60
- if it is carry over we need to continue carry over when we come end of the integer we can just add the 1 to end of integer
61
- Then dont forget the reverse result, thats it!
57
+ - reverse it -> ` 9651 `
58
+ - Add the carry to firs digit -> ` 9 + 1 = 10 `
59
+ - Check for carry-over ->Since 10 creates a carry ` (10 == 10) ` , we continue propagating it.
60
+ - If it is carry over we need to continue carry over when we come end of the integer we can just add the 1 to end of integer
61
+ - Then dont forget the reverse result, thats it!
62
62
63
63
## Time and Space Complexity
64
64
You can’t perform that action at this time.
0 commit comments