class Solution:
def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:
nums = nums1 + nums2
l = len(nums)
if l==1:
return(nums[0])
nums.sort()
if l%2==0:
re = (nums[int(l/2) - 1] + nums[int(l/2)])/2
else:
re = nums[int((l-1)/2)]
return(re)
网友评论