feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,32 @@ categories:
|
||||
patterns:
|
||||
- matrix-traversal
|
||||
|
||||
function_signature: "def first_missing_positive(nums: list[int]) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { nums: [1, 2, 0] }
|
||||
expected: 3
|
||||
- input: { nums: [3, 4, -1, 1] }
|
||||
expected: 2
|
||||
- input: { nums: [7, 8, 9, 11, 12] }
|
||||
expected: 1
|
||||
hidden:
|
||||
- input: { nums: [1] }
|
||||
expected: 2
|
||||
- input: { nums: [2] }
|
||||
expected: 1
|
||||
- input: { nums: [1, 2, 3, 4, 5] }
|
||||
expected: 6
|
||||
- input: { nums: [-1, -2, -3] }
|
||||
expected: 1
|
||||
- input: { nums: [0, 0, 0] }
|
||||
expected: 1
|
||||
- input: { nums: [1, 1, 1, 1] }
|
||||
expected: 2
|
||||
- input: { nums: [2, 1] }
|
||||
expected: 3
|
||||
|
||||
description: |
|
||||
Given an unsorted integer array `nums`, return the *smallest positive integer* that is *not present* in `nums`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user