Kth Smallest in Two Sorted Arrays
Kth Smallest in Two Sorted Arrays Kth Smallest in Two Sorted Arrays selects an element from the sorted union of two arrays without explicitly merging them. The main idea is to discard prefixes that cannot contain the answer. Since both arrays are sorted, comparing middle candidates lets us remove many elements at once. Problem Given two sorted arrays $A$ and $B$, and a zero-based rank $k$, return the k-th smallest...