Φόρτωση της άσκησης…
When a number is very large, it can be stored as an array of digits instead of a regular int. The function plus_one receives a list digits, with the most significant digit first. Add 1 to this number and return the result in the same digit-list format. Remember the carry case, such as 9 becoming [1, 0].
[[1, 2, 3]][1, 2, 4][[4, 3, 2, 1]][4, 3, 2, 2][[9]][1, 0]def plus_one(digits):
Συνδεθείτε για να δείτε το ιστορικό υποβολών
ΣύνδεσηΣυνδεθείτε για να χρησιμοποιήσετε τον AI Mentor
Σύνδεση[1,2,3][1,2,4][4,3,2,1][4,3,2,2][9][1,0][9,9,9][1,0,0,0][0][1][1,2,3,1,2][1,2,3,1,3]