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

@@ -8,6 +8,26 @@ categories:
patterns:
- two-pointers
function_signature: "def get_concatenation(nums: list[int]) -> list[int]:"
test_cases:
visible:
- input: { nums: [1, 2, 1] }
expected: [1, 2, 1, 1, 2, 1]
- input: { nums: [1, 3, 2, 1] }
expected: [1, 3, 2, 1, 1, 3, 2, 1]
hidden:
- input: { nums: [1] }
expected: [1, 1]
- input: { nums: [5, 4, 3, 2, 1] }
expected: [5, 4, 3, 2, 1, 5, 4, 3, 2, 1]
- input: { nums: [1, 1, 1] }
expected: [1, 1, 1, 1, 1, 1]
- input: { nums: [7] }
expected: [7, 7]
- input: { nums: [100, 200] }
expected: [100, 200, 100, 200]
description: |
Given an integer array `nums` of length `n`, you want to create an array `ans` of length `2n` where `ans[i] == nums[i]` and `ans[i + n] == nums[i]` for `0 <= i < n` (**0-indexed**).