Skip to content

Commit a19adbc

Browse files
committed
2nd one of the day done
1 parent b678d62 commit a19adbc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

27. Remove Element.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Solution {
2+
public:
3+
int removeElement(vector<int>& nums, int val) {
4+
int index = 0;
5+
for(auto x:nums)
6+
{
7+
if(x!=val)
8+
{
9+
nums[index] = x;
10+
index++;
11+
}
12+
}
13+
return index;
14+
}
15+
};

0 commit comments

Comments
 (0)