An array is considered special if every pair of its adjacent elements contains two numbers with different parity.
You are given an array of integers
nums. Returntrueifnumsis a special array, otherwise, returnfalse.
1 | class Solution { |
An array is considered special if every pair of its adjacent elements contains two numbers with different parity.
You are given an array of integers
nums. Returntrueifnumsis a special array, otherwise, returnfalse.
1 | class Solution { |