๋ฌธ์
์ฝ๋
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
nums.erase(unique(nums.begin(),nums.end()),nums.end());
return nums.size();
}
};
'Algorithm ๐ง๐ปโ๐ป > Leetcode' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Leetcode,c++] Next Permutation (0) | 2021.11.14 |
---|---|
[Leetcode,c++] Length of Last Word (0) | 2021.11.14 |
[Leetcode,c++] Container With Most Water (0) | 2021.11.14 |
[Leetcode,c++] Longest Common Prefix (0) | 2021.11.11 |
[Leetcode,c++] Permutations (0) | 2021.11.10 |
[Leetcode,c++] Best Time to Buy and Sell Stock (0) | 2021.11.10 |
๋๊ธ