參考資訊:
https://www.cnblogs.com/grandyang/p/4822732.html
題目:
解答:
void moveZeroes(int* nums, int numsSize) { int cc = 0; int idx = 0; for (cc = 0; cc < numsSize; cc++) { if (nums[cc]) { nums[idx] = nums[cc]; if (cc != idx) { nums[cc] = 0; } idx += 1; } } }