Practice Airplane Seat Assignment Probability
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Airplane Seat Assignment Probability
Problem Statement
n passengers board in their assigned-seat order. The first chooses uniformly from all n seats after losing the ticket. Each later passenger takes their assigned seat if free, or chooses uniformly among remaining free seats if it is occupied. Return the probability that the final passenger sits in their own seat.
Source: Airplane Seat Assignment Probability on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
n = 1
1.00000
# Example 2
n = 2
0.50000
Constraints
Related LeetCode Problems
Practice more problems similar to Airplane Seat Assignment Probability.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.