Search
⌘K

Leetcode 1227. Airplane Seat Assignment Probability

Given n passengers where the first picks a random seat and each subsequent passenger takes their own seat if available or otherwise chooses uniformly among remaining seats, compute the probability the nth passenger ends up in their assigned seat — a probability that follows a simple recurrence and equals 1 for n=1 and 1/2 for all n ≥ 2.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.