Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Plus One
Bookmark
Input
Standard
Single Carry
All Nines
Zero
Double Carry
Custom
digits
=
[1, 2, 3]
digits
0
1
2
1
2
3
digits
0
1
2
1
2
3
digits
0
1
2
1
2
3
i
carry +1
is
3
< 9 ? yes → add the 1
digits
0
1
2
1
2
4
i
carry +1
3
+ 1 =
4
· carry absorbed
digits
0
1
2
1
2
4
result = [1, 2, 4]
algo
master
.
io
Step:
Add one to the number 123
0 / 3
Input
Standard
Single Carry
All Nines
Zero
Double Carry
Custom
digits
=
[1, 2, 3]
0 / 3
algo
master
.
io
Step:
Add one to the number 123