← All problemsSign in

Subarray Count

You are given an array $A$ of size $N$, where $i$ th element Ai can be either $0$ or $1$. You need to find all subarrays of $A$ with equal number of $0$ and $1$. ###Input: The input consists of $3$ lines. - First line denotes $T$ - number of test cases. - Second line contains an integer $N$ - size of array - Third line contains $N$ integers ###Output: Print a single integer, denoting the answer

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start