Binary Search
Halve the search space on sorted arrays, master lower_bound-style invariants, and use binary search on the answer when a property flips from false to true — with short C++ and contest habits.
Halve the search space on sorted arrays, master lower_bound-style invariants, and use binary search on the answer when a property flips from false to true — with short C++ and contest habits.