mirror of
https://github.com/TheAlgorithms/C
synced 2025-04-22 13:16:14 +03:00
11 lines
235 B
C
11 lines
235 B
C
void moveZeroes(int* nums, int numsSize){
|
|
int i, start = 0;
|
|
for (i = 0; i < numsSize; i++) {
|
|
if(nums[i])
|
|
nums[start++] = nums[i];
|
|
}
|
|
for(;start < numsSize; start++) {
|
|
nums[start] = 0;
|
|
}
|
|
}
|