Finish problem 0704-binary-search

This commit is contained in:
Johan Sandoval
2026-07-22 20:20:08 -05:00
parent 71585b97b8
commit d1fefee020
2 changed files with 26 additions and 0 deletions
@@ -0,0 +1,13 @@
import pytest
from solution import Solution
@pytest.mark.parametrize(
"nums, target, expected",
[
([-1, 0, 3, 5, 9, 12], 9, 4),
([-1, 0, 3, 5, 9, 12], -2, -1),
],
)
def test_binary_search(nums, target, expected):
assert Solution().search(nums, target) == expected