Tap here to switch tabs
Problem
Submissions

Problem: Special Array I

med
30 min
Try to solve the Special Array I problem.

Statement

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 nums contains only one element, it is special.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Special Array I

med
30 min
Try to solve the Special Array I problem.

Statement

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 nums contains only one element, it is special.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100