We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent edcf761 commit 4b84b01Copy full SHA for 4b84b01
27-remove-element/27-remove-element.cpp
@@ -3,10 +3,10 @@ class Solution {
3
public:
4
int removeElement(vector<int>& nums, int val) {
5
int k=0;
6
- for(int i=0; i<nums.size(); i++)
7
- {
8
- if(nums[i] == val) continue;
9
- else{
+ for(int i=0; i<nums.size(); i++){
+ if(nums[i] == val){
+ continue;
+ }else{
10
nums[k] = nums[i];
11
k += 1;
12
}
0 commit comments