Count Subarrays with Equal Number of Even and Odd Numbers

Given an integer array nums, count the number of contiguous subarrays in which the number of even elements equals the number of odd elements.

Input format: The first line contains an integer n,...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: