2
def minDeletion(self, nums: List[int]) -> int:4
# we first only consider requirement 2: nums[i] != nums[i + 1] for all i % 2 == 05
# at the begining, we consider the num on the even index6
# when we delete a num, we need consider the num on the odd index7
# then repeat this process8
# at the end we check the requirement 1: nums.length is even or not12
# flag is true then check the even index13
# flag is false then check the odd index17
# check the even index19
if i % 2 == 0 and i != n - 1 and nums[i] == nums[i + 1]:24
if i % 2 == 1 and i != n - 1 and nums[i] == nums[i + 1]:30
return count if curLength % 2 == 0 else count + 1