Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3096. Minimum Levels to Gain More Points
Given a binary array where playing a level gives +1 for 1 and -1 for 0, find the minimum number of initial levels Alice must play (at least 1 and leaving at least one for Bob) so her prefix score exceeds Bob's suffix score. This reduces to finding the smallest prefix length k with 2*prefix_sum > total_sum (return -1 if none).
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.