. - 力扣(LeetCode)

from typing import List
 
 
class Solution:
	def isArraySpecial(self, nums: List[int]) -> bool:
		is_odd = nums[0] % 2 == 0
		for i in range(1, len(nums)):
			odd = nums[i] % 2 == 0
			if odd == is_odd:
				return False
			is_odd = odd
		return True