Tags: idea assignment array access access. com pointer amp is a direct
/* First Appearance 0 */
/* Record the number of consecutive 0 N */
/* Second occurrence 0 record position */
/* Move all elements before the second 0 to the left n*/
/* Return to step two */
/* Finally assign all remaining positions to the 0*/
Problems encountered in the implementation:
1, array access out of bounds,&& operator order, first cannot cross
2, record the number of 0, carefully consider the position
This type of array in-situ delete the data, the study is two pointer application, pay attention to grasp the idea of two pointers, this kind of problem can be solved.
Suddenly, the array elements can be directly assigned to the double pointer problem.
Leetcode Move Zero