Hard
Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log(m+n)).
The median of an array of length L is the (L/2)-th element if L is odd, or the average of the (L/2-1)-th and (L/2)-th elements if L is even (0-indexed, integer division). For this problem, return the integer part (floor) of the median.
Input: nums1 = [1,3], nums2 = [2] Output: 2
Input: nums1 = [1,2], nums2 = [3,4] Output: 2