Leetcode Problem 1227. Airplane Seat Assignment Probability

1227. Airplane Seat Assignment Probability

Leetcode Solutions

Probability of the nth Person Getting Their Own Seat

  1. Check if n is equal to 1. If so, return 1.0 because the first and only passenger will definitely sit in their own seat.
  2. If n is greater than 1, return 0.5 because the probability of the nth person getting their own seat is 50%.
UML Thumbnail

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...