Skip to content

Commit

Permalink
Time: 11 ms (34.86%) | Memory: 21.9 MB (8.73%) - LeetSync
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimple-01 committed Jun 12, 2024
1 parent 65d0c52 commit 49f3ed7
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
set<int>se;
for(auto & values : nums)
{
se.insert(values);

}
int j=0;
for(auto i= se.begin();i!=se.end();++i)
{
nums[j++]= *i;
}
return se.size();
}
};

0 comments on commit 49f3ed7

Please sign in to comment.