feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,24 @@ categories:
|
||||
patterns:
|
||||
- dynamic-programming
|
||||
|
||||
function_signature: "def nth_person_gets_nth_seat(n: int) -> float:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { n: 1 }
|
||||
expected: 1.0
|
||||
- input: { n: 2 }
|
||||
expected: 0.5
|
||||
hidden:
|
||||
- input: { n: 3 }
|
||||
expected: 0.5
|
||||
- input: { n: 10 }
|
||||
expected: 0.5
|
||||
- input: { n: 100 }
|
||||
expected: 0.5
|
||||
- input: { n: 1000 }
|
||||
expected: 0.5
|
||||
|
||||
description: |
|
||||
`n` passengers board an airplane with exactly `n` seats. The first passenger has lost their ticket and picks a seat randomly. After that, the rest of the passengers will:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user