Simple Java Solution - One pass
```\nclass Solution {\n    public int minDeletion(int[] nums) {\n        if(nums.length==0)\n            return 0;\n        Integer prev = null;\n        int ci
```\nclass Solution {\n    public int minDeletion(int[] nums) {\n        if(nums.length==0)\n            return 0;\n        Integer prev = null;\n        int ci = 0;\n        for(int i=0;i<nums.length;i++){\n            \n            if(prev!=null)\n            {\n                if(nums[i]!=prev){\n                    ci+=2;\n                    prev = null;\n                }                \n            }else{\n                prev = nums[i];\n            }\n        }\n        return nums.length-ci;\n    }\n}
[]