Skip to content

Commit 20aa6df

Browse files
authored
feat: add cpp solution to lc porblem: No.0026 (#699)
1 parent e294e66 commit 20aa6df

File tree

1 file changed

+10
-0
lines changed
  • solution/0000-0099/0026.Remove Duplicates from Sorted Array

1 file changed

+10
-0
lines changed

solution/0000-0099/0026.Remove Duplicates from Sorted Array/README_EN.md

+10
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ public:
100100
};
101101
```
102102
103+
```cpp
104+
class Solution {
105+
public:
106+
int removeDuplicates(vector<int>& nums) {
107+
nums.erase(unique(nums.begin(), nums.end()), nums.end());
108+
return nums.size();
109+
}
110+
};
111+
```
112+
103113
### **Go**
104114

105115
```go

0 commit comments

Comments
 (0)