#3152
Special Array II
specialist · 935 · lc medium +32 · 45.8% accepted · 915 likes · top 29%
Description
A subarray is special if every adjacent pair within it has different parity. Given nums and range queries queries[i] = [fromi, toi], return a boolean array where entry i is true when nums[fromi..toi] is special.
Code
1
2
3