Simple Solution in Java || Elegant and Concise
\nclass Solution {\n    public int minDeletion(int[] nums) {\n        \n       boolean evenIndex = true;\n       int ans = 0;        \n       int i = 0;\n      
```\nclass Solution {\n    public int minDeletion(int[] nums) {\n        \n       boolean evenIndex = true;\n       int ans = 0;        \n       int i = 0;\n        while(i < nums.length){\n            if(evenIndex == false){\n                // The current number is at odd index, the next will be at even index\n                evenIndex = !evenIndex;\n                i++;\n                continue;\n            }\n            \n            int j = i+1;\n            while(j<nums.length && nums[j] == nums[j-1]){\n                j++;\n            }\n            \n            if(j == nums.length){ \n                // The starting index was at even position and it\'s repetition is till the end of the array, we have to delete all the numbers \n                // From starting to the end \n                ans += j - i;\n            }\n            else ans += (j - i - 1);\n            \n            // The current number is at even index, the next will be at odd index\n            evenIndex = !evenIndex;\n            \n            i = j;\n        }\n        \n        return ans;\n    }\n}\n```
[]