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