1.Given an array arr[] of size N containing 0s and 1s only.
2.The task is to count the subarrays having equal number of 0s and 1s.
3.You have to complete the function countSubArrays() which should return the count of subarrays.
Input Format
1.First line contains the an integer 'N' denotind the size of array 2.Second line contains the 'N' separated elements of array.
Output Format
Print the count of required subarrays.
Constraints
1 <= N <= 10^6 0 <= A[i] <= 1
Notice
Try First, Check Solution later
1. You should first read the question and watch the question video.2. Think of a solution approach, then try and submit the question on editor tab.3. We strongly advise you to watch the solution video for prescribed approach.Example
Input
7 1 0 0 1 0 1 1
Output
8