打卡记录 美化数组的最少删除数(贪心) 链接 class Solution:def minDeletion(self, nums: List[int]) -> int:n, cnt = len(nums), 0for i in range(n):if (i - cnt) % 2 == 0 and i + 1 < n and nums[i] == nums[i + 1]:cnt += 1return cnt + 1 if (n - cnt) % 2 != 0 else cnt