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
. Returntrue
ifnums
is 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
. Returntrue
ifnums
is a special array, otherwise, returnfalse
.
1 | class Solution { |