本文共 266 字,大约阅读时间需要 1 分钟。
就是把一些列数组中的0给弄到最后去
对数组中遍历,非0添加到新数组,用下标标记,到遍历结束,把下标之后的数组元素都填0
(一看代码就懂 = =)class Solution {public: void moveZeroes(vector & nums) { int len = nums.size(); int idx = 0; for(int i=0;i
happy coding seen
转载地址:http://poujn.baihongyu.com/