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,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`.