← practice

Binary Search

sorted data · search on answer
Binary search is more than "find in a sorted array." The senior-level skill is recognizing the "search on the answer" pattern — when the answer lives in a numeric range and you can check feasibility in O(n). Memorize the lower-bound template (lo < hi, hi = mid) — it solves first/last position, insert point, and boundary problems with one shape.

5 problems

Next patternBit Manipulation