C++ easy to understand
Just skip untill adjacent pair is equal.\n\n\nclass Solution {\npublic:\n    int minDeletion(vector<int>& nums) {\n        int ans = 0;\n        int n = nums.si
Just skip untill adjacent pair is equal.\n\n```\nclass Solution {\npublic:\n    int minDeletion(vector<int>& nums) {\n        int ans = 0;\n        int n = nums.size();\n        int i = 0;\n        while(i < n){\n            int j = i + 1;\n            while(j < n and nums[i] == nums[j]){\n                j += 1;\n            }\n            if(j == n){\n                ans += j - i;\n            }\n            else{\n                ans += j - i - 1;\n            }\n            i = j + 1;\n            \n        }\n        return ans;\n    }\n};\n```
['Two Pointers', 'Greedy']