medium10 pts · first answer countshash-mapprefix-sums
Longest subarray with equal 0s and 1s
Treating 0 as -1, you track the first index of each running sum. What is the longest subarray of [0, 1, 0] with equal 0s and 1s?
Discussion 0
Join free to post in the discussion.
Related questions
- Range sum from a prefix arrayBackend Developer
- Compute a range sumBackend Developer
- Fast rectangle sums on a gridBackend Developer
- Many range increments at onceBackend Developer
- Running wallet balanceBackend Developer
- Cost of prefix sum queriesBackend Developer
- Average cost of a hash map lookupBackend Developer
- Worst case for a hash map lookupBackend Developer