Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 525. Contiguous Array
Find the maximum length of a contiguous subarray in a binary array that contains an equal number of 0s and 1s. This is solved by using a running sum (treat 0 as -1) and a hash map to record first occurrences of each cumulative sum to find longest zero-sum spans in O(n) time for n up to 1e5.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.