My simple python solution


  • 0
    A

    ...
    def findMedianSortedArrays(self, nums1, nums2):
    """
    :type nums1: List[int]
    :type nums2: List[int]
    :rtype: float
    """
    nums3=nums1+nums2
    nums3.sort()

        if len(nums3)%2!=0:
            return nums3[len(nums3)//2]
        else:
            return (nums3[len(nums3)//2]+nums3[len(nums3)//2 - 1])/2
        ...

Log in to reply
 

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