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