feat(content): function signatures + test cases
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user