feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent 9e6c6d256f
commit 65a8d525f5
203 changed files with 4526 additions and 0 deletions

View File

@@ -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: