Use two pointer, slow and fast, slow maintain the updated index, fast maintain the old index, when fast meet a non-zero element, assign to slow index and slow++
Error:
N/A
leetcode-283-Move Zeroes
最新推荐文章于 2022-06-27 14:37:23 发布
Use two pointer, slow and fast, slow maintain the updated index, fast maintain the old index, when fast meet a non-zero element, assign to slow index and slow++
Error:
N/A