Maximize Distance to Closest Person

Medium · Greedy · about 15 minutes

Asked at Google, Amazon, Roblox, Adobe, Snowflake, Electronic Arts, Unity.

seats[i] is 1 if seat i is taken and 0 if empty (at least one of each). Alex sits in an empty seat so that the distance to the closest person is maximized. Return that maximum distance.