LeetCode 4 Median of Two Sorted Arrays - Problem Statement

The problem

Given two sorted arrays nums1 and nums2, return the median of the combined sorted array.

With nums1 = [1, 3] and nums2 = [2], the answer is 2.0. The merged array is [1, 2, 3], and the median is the middle element.

With nums1 = [1, 2] and nums2 = [3, 4], the answer is 2.5. The merged array is [1, 2, 3, 4], and the median is (2 + 3) / 2.

You must achieve O(log(m+n))O(\log(m + n)) runtime. How can you find the median without actually merging?

Constraints: Arrays can be empty. Combined length is at least 11.