Exercises I
Easy: 2 ; Medium: 2
Remove Element
class Solution {
public:
int removeElement(vector<int>& nums, int val) {
if(nums.empty())return 0;
int index=0;
for(int n:nums)
if(n!=val) nums[index++]=n;
return index;
}
};Move Zeroes
Shortest Subarray to be Removed to Make Array Sorted
Remove Covered Intervals
最后更新于