Skip to content

Commit 9b15c6a

Browse files
committed
comments
1 parent f874fde commit 9b15c6a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎algorithms/cpp/moveZeroes/moveZeroes.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Solution {
6262
* We have two pointers to travel the array, assume they named `p1` and `p2`.
6363
*
6464
* 1) `p1` points the tail of current arrays without any ZEROs.
65-
* 2) `p2` points the head of the reset array which skips the ZEROs.
65+
* 2) `p2` points the head of the rest array which skips the ZEROs.
6666
*
6767
* Then we can just simply move the item from `p2` to `p1`.
6868
*
@@ -80,6 +80,7 @@ class Solution {
8080
nums[p1++] = nums[p2];
8181
}
8282

83+
//set ZERO for rest items
8384
while ( p1<nums.size() ) nums[p1++] = 0;
8485
}
8586

0 commit comments

Comments
 (0)