Binary Search · Easy
Binary Search
O(log N) · O(1)
Initialize Binary Search Bounds
Array is sorted. Set Low = 0 (val -1) and High = 5 (val 12). Target = 9.
Array Elements & Pointers
Low ↓
-1
[0]0
[1]3
[2]5
[3]9
[4]High ↓
12
[5]Live Variables & Invariants
target:9
low:0
high:5
Step 1 / 5
20%
Solution Code
LeetCode IDE Console
Test Cases
4 cases from Blind 75 & NeetCode 150
Ask for a hint whenever you get stuck.