04 Median of Two Sorted Arrays
Given two sorted arrays
nums2 of size
n respectively, return the median of the two sorted arrays.
The overall run time complexity should be
It would be pretty easy just to use a O(n) merge and then pick the middle point. However, this problem requires a O(log (m+n)) time complexity.
I haven’t come up with the solution and searched online and it explains this problem crestal clear:
I’ll try to explain it myself (, as a practice of English writing).