C# Solution in O(N) time & without space
\n# Complexity\n- Time complexity:\nO(N)\n- Space complexity:\nO(1)\n# Code\n\npublic class Solution {\n    public int MinDeletion(int[] nums) {\n        int re
\n# Complexity\n- Time complexity:\nO(N)\n- Space complexity:\nO(1)\n# Code\n```\npublic class Solution {\n    public int MinDeletion(int[] nums) {\n        int res = 0, i = 0;\n        while(i < nums.Length){\n            int j = i + 1;\n            while(j < nums.Length && nums[j] == nums[i]){\n                res++;\n                j++;\n            }\n            if(j == nums.Length)res++;\n            i = j + 1;\n        }\n        return res;\n    }\n}\n```
['Array', 'C#']