feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent d2b74b6863
commit 85fea3a4bb
94 changed files with 1840 additions and 0 deletions

View File

@@ -9,6 +9,26 @@ categories:
patterns:
- binary-search
function_signature: "def search(nums: list[int], target: int) -> int:"
test_cases:
visible:
- input: { nums: [4, 5, 6, 7, 0, 1, 2], target: 0 }
expected: 4
- input: { nums: [4, 5, 6, 7, 0, 1, 2], target: 3 }
expected: -1
- input: { nums: [1], target: 0 }
expected: -1
hidden:
- input: { nums: [1], target: 1 }
expected: 0
- input: { nums: [3, 1], target: 1 }
expected: 1
- input: { nums: [5, 1, 3], target: 5 }
expected: 0
- input: { nums: [1, 2, 3, 4, 5], target: 3 }
expected: 2
description: |
There is an integer array `nums` sorted in ascending order (with **distinct** values).