The time to reach a particular seat from the front of the queue can be calculated as the summation of the row number of that seat and how far that seat is from aisle. In this way, the time to reach all 240 seats from the front of the queue can be calculated. We need to consider the N (N <= 240) smallest times out of those 240. Let's say we take n values and keep them in an array A in descending order. We assign the first person in the queue to the furthest of the n seats, second person to the second furthest and so on to minimize the time when the last person reaches the assigned seat. Ultimately the answer is the maximum of {0 + A0, 1 + A1, ..., n - 1 + An-1}.

Statistics

80% Solution Ratio
mdyaminEarliest, Apr '19
mdyaminFastest, 0.0s
pabonsahaLightest, 0 B
bokaifShortest, 35B
Toph uses cookies. By continuing you agree to our Cookie Policy.