Binary search to find the correct partition in both arrays. If you take elements from nums1 and elements from nums2 where , the median is determined by the boundary elements.
Binary search on (partition point in smaller array).
.
Valid partition: maxLeft1 <= minRight2 and maxLeft2 <= minRight1.
If maxLeft1 > minRight2, decrease . If maxLeft2 > minRight1, increase .