Here is my python simplest code:


  • -1
    A
    class Solution(object):
        def findMedianSortedArrays(self, nums1, nums2):
            num = nums1 + nums2
            num.sort()
            length = len(num)
            if length%2==0:
                indx = length/2
                return (num[indx-1] + num[indx])/2.
            else:
                indx = (length + 1)/2
                return num[indx-1]
    
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.