public class Solution {
public int removeElement(int[] nums, int val) {
int j = 0;
for(int i = 0; i < nums.length; i++){
if(nums[i] != val){
nums[j++] = nums[i];
}
}
return j;
}
}
LeetCode-27 Remove Element
最新推荐文章于 2024-03-25 22:40:48 发布