A simple dp solution
\npublic int minDeletion(int[] nums) {\n\tint l = nums.length;\n\tint[] dp = new int[l];\n\tdp[0] = 0;\n\tfor(int i=1; i<l; i++) {\n\t\t// Check nums[i] != nums
```\npublic int minDeletion(int[] nums) {\n\tint l = nums.length;\n\tint[] dp = new int[l];\n\tdp[0] = 0;\n\tfor(int i=1; i<l; i++) {\n\t\t// Check nums[i] != nums[i + 1] for all i % 2 == 0.\n\t\tif((nums[i] == nums[i-1]) && ((i-1-dp[i-1])%2 == 0)) {\n\t\t\tdp[i] = dp[i-1] + 1;\n\t\t}\n\t\telse\n\t\t\tdp[i] = dp[i-1];\n\t}\n\t\n\t// Check nums.length is even.\n\treturn (l-dp[l-1])%2 == 0 ? dp[l-1] : dp[l-1]+1;\n}\n```
[]