Skip to content

1227. Airplane Seat Assignment Probability 👎

  • Time:
  • Space:
1
2
3
4
5
6
class Solution {
 public:
  double nthPersonGetsNthSeat(int n) {
    return n == 1 ? 1 : 0.5;
  }
};
1
2
3
4
5
class Solution {
  public double nthPersonGetsNthSeat(int n) {
    return n == 1 ? 1 : 0.5;
  }
}
1
2
3
class Solution:
  def nthPersonGetsNthSeat(self, n: int) -> float:
    return 1 if n == 1 else 0.5