Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 849. Maximize Distance to Closest Person
Given a binary array where 1s are occupied seats, find an empty seat that maximizes the distance to the nearest occupied seat. The core challenge is identifying the longest runs of zeros (with edge runs counted fully and interior runs giving half the run length) to compute the maximal minimum distance.
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.