1
0
mirror of https://github.com/SunnyQjm/algorithm-review.git synced 2026-06-12 02:37:58 +08:00

Update 3_leetcode66.py

This commit is contained in:
2020-06-20 19:38:25 +08:00
committed by GitHub
parent 70c0e8f56d
commit c329bf9c8e
+1 -1
View File
@@ -31,7 +31,7 @@ class Solution:
算法思路:
1. 从最末尾开始遍历;
2. 当前元素+1,不足10则结束,满10则执行进位
2. 当前元素+1,不足10则结束,满10则执行进位
=> 进位就将当前元素值置为0,然后下标左移,继续判断
3. 如果遍历到头元素了还有进位,则需要在头元素之前插入一个元素,值为1