TheAlgorithms-C/leetcode/src/27.c
2019-09-26 08:29:31 -07:00

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;
}