题目难度:简单
题目地址:
https://leetcode-cn.com/problems/remove-element/
// 提交答案
int removeElement(int* nums, int numsSize, int val){
if(numsSize==0)
return 0;
int p1 = 0, len = 0;
for(p1=0;p1<numsSize;p1++){
if(nums[p1]!=val){
nums[len]=nums[p1];
len++;
}
}
return len;
}
第二天了,慢慢来!!!