
Given an integer array nums, return the length of the longest contiguous subarray where the number of odd integers is equal to the number of even integers. If no such subarray exists, return 0.
Explanation: The subarray [5, 8, 2, 7] contains two odd integers (5, 7) and two even integers (8, 2). The length is 4.
Explanation: The subarray [1, 2, 3, 4] has two odd and two even integers, resulting in length 4.
Access the full code editor, ThinkBuddy AI hints, and track your progress.