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