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