112. Median of Two Sorted Arrays
HardBinary search
Given two sorted arrays a and b, return the median of all their values combined. The target complexity is O(log(min(m, n))).
Example 1
Input: a = [1, 3], b = [2] Output: 2
Example 2
Input: a = [1, 2], b = [3, 4] Output: 2.5
Constraints
0 ≤ m, n ≤ 1000m + n ≥ 1