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:
@@ -31,7 +31,7 @@ class Solution:
|
||||
|
||||
算法思路:
|
||||
1. 从最末尾开始遍历;
|
||||
2. 堆当前元素+1,不足10则结束,满10则执行进位
|
||||
2. 对当前元素+1,不足10则结束,满10则执行进位
|
||||
=> 进位就将当前元素值置为0,然后下标左移,继续判断
|
||||
|
||||
3. 如果遍历到头元素了还有进位,则需要在头元素之前插入一个元素,值为1
|
||||
|
||||
Reference in New Issue
Block a user