Dsa
Sliding Window
Medium
Contiguous Array
Given a binary array nums, find the maximum length of a contiguous subarray with an equal number of 0 and 1.
Example:
Input: [0,1]
Output: 2, (subarray [0, 1] has equal number of 0s and 1s).
Key concepts
sliding_windowarray
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now