๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Algorithm ๐Ÿง‘๐Ÿป‍๐Ÿ’ป/Leetcode

[Leetcode,c++] Remove Duplicates from Sorted Array

by dkswnkk 2021. 11. 14.

๋ฌธ์ œ

 

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

๋Œ“๊ธ€