[LeetCode] 3152. Special Array II (Python)
·
알고리즘/LeetCode
난이도: Medium 문제 설명An array is considered special if every pair of its adjacent elements contains two numbers with different parity. You are given an array of integer nums and a 2D integer matrix queries, where for queries[i] = [from_i, to_i] your task is to check that subarray nums[from_i..to_i] is special or not. Return an array of booleans answer such that answer[i] is true if nums[from_i..to_i..