Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2483. Minimum Penalty for a Shop
Given a string of 'Y'/'N' arrivals, choose an index j (0..n) to close the shop so that open hours with 'N' and closed hours with 'Y' incur the fewest penalties; return the earliest j minimizing that score. This reduces to finding the split that minimizes mismatches and can be found with a single pass using prefix/suffix counts.
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.