๋ฌธ์
Remove Duplicates from Sorted Array - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
์ฝ๋
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 |
๋๊ธ