Solution to MedianOfTwoSortedArrays

O(M+N) time and O((M+N)/2) extra space