β back to unit
Medium
# searching medium
Is It Even There?
The sorted warehouse ledger is a million lines long β the boss just wants yes or no. π¦
You get a SORTED list of nums and a target. Print yes if it's in the list, no if not β with the split-in-half strategy, not a full scan.
Example:
Input: nums = [3, 8, 12, 20, 31], target = 12
Output: yes
Splitting the range in half repeatedly narrows the search straight down to 12.
π‘ need a hint?
srch-is-it-there.pyπ given lines are locked β write your code in between
loading...