目录
一、题目描述
二、题解
三、源码
class Solution(object):
def findMedianSortedArrays(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: float
"""
arr = []
arr.extend(nums1)
arr.extend(nums2)
arr.sort()
if (len(arr) % 2 ==0) :
return float(((arr[(len(arr) / 2) - 1]) + (arr[((len(arr) / 2) + 1) - 1] ))) / 2
else :
return arr[int((len(arr) - 1) / 2)]