feat(content): function signatures + test cases

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

View File

@@ -9,6 +9,26 @@ categories:
patterns:
- backtracking
function_signature: "def count_arrangement(n: int) -> int:"
test_cases:
visible:
- input: { n: 2 }
expected: 2
- input: { n: 1 }
expected: 1
hidden:
- input: { n: 3 }
expected: 3
- input: { n: 4 }
expected: 8
- input: { n: 5 }
expected: 10
- input: { n: 6 }
expected: 36
- input: { n: 10 }
expected: 700
description: |
Suppose you have `n` integers labelled `1` through `n`. A permutation of those `n` integers `perm` (**1-indexed**) is considered a **beautiful arrangement** if for every `i` (`1 <= i <= n`), **either** of the following is true: