Week 2 · Day 13 of 42
Binary Search: On Answer / Condition Function and Median and Kth of Two Sorted Arrays
If the problem asks "what is the minimum X such that condition is feasible?" — binary search on X. Write a feasibility checker, then find the boundary where it flips from False to True. Median of two sorted arrays → binary search on the smaller array's partition. Find a cut where left halves of both arrays contain exactly half the total elements, and max(left) <= min(right).
Checking access
Spotted a mistake on this page?
Wrong formula, broken animation or confusing wording. Tell us and we will fix it.