feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent d65ccf7dc2
commit 0262ca8bf6
203 changed files with 4526 additions and 0 deletions

View File

@@ -9,6 +9,30 @@ categories:
patterns:
- binary-search
function_signature: "def find_in_mountain_array(target: int, mountain_arr: MountainArray) -> int:"
test_cases:
visible:
- input: { mountain_arr: [1, 2, 3, 4, 5, 3, 1], target: 3 }
expected: 2
- input: { mountain_arr: [0, 1, 2, 4, 2, 1], target: 3 }
expected: -1
hidden:
- input: { mountain_arr: [1, 2, 3, 4, 5, 3, 1], target: 1 }
expected: 0
- input: { mountain_arr: [1, 2, 3, 4, 5, 3, 1], target: 5 }
expected: 4
- input: { mountain_arr: [1, 5, 2], target: 2 }
expected: 2
- input: { mountain_arr: [1, 5, 2], target: 1 }
expected: 0
- input: { mountain_arr: [1, 5, 2], target: 5 }
expected: 1
- input: { mountain_arr: [1, 2, 3, 4, 3, 2, 1], target: 0 }
expected: -1
- input: { mountain_arr: [0, 5, 3, 1], target: 0 }
expected: 0
description: |
*(This problem is an **interactive problem**.)*