Median of Two Sorted Arrays - Partition Approach

Binary search to find the correct partition in both arrays. If you take ii elements from nums1 and jj elements from nums2 where i+j=(m+n+1)/2i + j = (m + n + 1) / 2, the median is determined by the boundary elements.

1.1. Binary search on ii (partition point in smaller array).

2.2. j=(m+n+1)/2ij = (m + n + 1) / 2 - i.

3.3. Valid partition: maxLeft1 <= minRight2 and maxLeft2 <= minRight1.

4.4. If maxLeft1 > minRight2, decrease ii. If maxLeft2 > minRight1, increase ii.