feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,28 @@ categories:
|
||||
patterns:
|
||||
- dynamic-programming
|
||||
|
||||
function_signature: "def beautiful_array(n: int) -> list[int]:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { n: 4 }
|
||||
expected: [2, 1, 4, 3]
|
||||
- input: { n: 5 }
|
||||
expected: [3, 1, 2, 5, 4]
|
||||
hidden:
|
||||
- input: { n: 1 }
|
||||
expected: [1]
|
||||
- input: { n: 2 }
|
||||
expected: [1, 2]
|
||||
- input: { n: 3 }
|
||||
expected: [1, 3, 2]
|
||||
- input: { n: 6 }
|
||||
expected: [3, 1, 2, 5, 6, 4]
|
||||
- input: { n: 10 }
|
||||
expected: [5, 3, 1, 7, 9, 6, 2, 4, 10, 8]
|
||||
- input: { n: 8 }
|
||||
expected: [5, 3, 1, 7, 6, 2, 4, 8]
|
||||
|
||||
description: |
|
||||
An array `nums` of length `n` is **beautiful** if:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user