1
2
9
9
[0][1][2][3]
Brute force · convert to a number
▸1value ← int(join(digits))2value ← value + 13return split(value) # overflows past ~19 digits
state
- value1299
warming up the animation
A non-negative integer is given as an array of digits, most significant first. Add one to it and return the resulting array of digits.
▸1value ← int(join(digits))2value ← value + 13return split(value) # overflows past ~19 digits
line 1Glue the digits into 1299, add one, then split the result back apart.