1
0
mirror of https://github.com/SunnyQjm/algorithm-review.git synced 2026-06-03 08:16:43 +08:00

Update homework2_leetcode66.py

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