Easy
感觉一下基本套路
class Solution {
public int removeElement(int[] nums, int val) {
int index = 0;
for (int i = 0; i < nums.length; i++){
if (nums[i] != val){
nums[index++] = nums[i];
}
}
return index;
}
}