Java solution | Easy
Please Upvote !!!\n\nclass Solution {\n    public int minDeletion(int[] nums) {\n        int delet = 0;\n        int n = nums.length;\n        \n        for (in
### **Please Upvote !!!**\n```\nclass Solution {\n    public int minDeletion(int[] nums) {\n        int delet = 0;\n        int n = nums.length;\n        \n        for (int i = 0; i < n - 1; i++) {\n            int newIndex = i - delet;\n            if (newIndex % 2 == 0 && nums[i] == nums[i + 1]) {\n                delet++;\n            }\n        }\n\n        return (n - delet) % 2 == 0 ? delet : delet + 1;\n    }\n}\n\n// TC: O(n), SC: O(1)\n```
['Java']