Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2155. All Divisions With the Highest Score of a Binary Array
Given a binary array, consider every split index i (0..n) and compute its score as zeros in the left part plus ones in the right part; return all indices with the maximum score. This is typically solved by tracking prefix zeros and remaining ones (or using prefix sums) to compute all scores in one pass.
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.