1227. Airplane Seat Assignment Probability
https://leetcode.com/problems/airplane-seat-assignment-probability
Description
n
passengers board an airplane with exactly n
seats. The first passenger has lost the ticket and picks a seat randomly. But after that, the rest of passengers will:
Take their own seat if it is still available,
Pick other seats randomly when they find their seat occupied
What is the probability that the n-th person can get his own seat?
Example 1:
Example 2:
Constraints:
1 <= n <= 10^5
ac
Last updated