mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
9 lines
203 B
C
9 lines
203 B
C
int removeElement(int* nums, int numsSize, int val) {
|
|
int i, start = 0;
|
|
for (i = 0; i < numsSize; i++) {
|
|
if(nums[i] != val)
|
|
nums[start++] = nums[i];
|
|
}
|
|
return start;
|
|
}
|