Given an integer array nums, determine whether it is special.
An array is considered special if every pair of adjacent elements nums[i] and nums[i+1] has different parity, meaning one is even and the other is odd.
Return true if nums is special, otherwise return false.
Note: If
numscontains only one element, it is special.
Constraints:
nums.length
nums[i]
Given an integer array nums, determine whether it is special.
An array is considered special if every pair of adjacent elements nums[i] and nums[i+1] has different parity, meaning one is even and the other is odd.
Return true if nums is special, otherwise return false.
Note: If
numscontains only one element, it is special.
Constraints:
nums.length
nums[i]