LeetCode | 1227. Airplane Seat Assignment Probability (probability title line of code in C ++)

Description

Original title link
Here Insert Picture Description

Algorithm


See detailed explanation
[Daily] Riddles algorithm Day 68: one line of code, but you will permit it?

C++ Solution

class Solution {
public:
    double nthPersonGetsNthSeat(int n) {
        return n == 1 ? 1 : 0.5;
    }
};
Published 308 original articles · won praise 149 · Views 150,000 +

Guess you like

Origin blog.csdn.net/qq_43827595/article/details/104840243