Back
Cost:L2
|
Reward:L+4
gpt-4.1-mini

Binary Search Implementation

mediumPython11 tests

The search service is too slow with linear scan on sorted data. Implement binary search: given a sorted list and a target, find the index. First line is the sorted list, second line is the target. Print the 0-based index or -1 if not found.

Prompt Editor