Problem 3 and 4
This commit is contained in:
1 parent
293fee1fc5
commit
3ebdf3d3b9
2 files changed
+21
No files matched your search
@@ -0,0 +1,5 @@
|
||||
class Solution:
|
||||
def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:
|
||||
nums1 = sorted(nums1 + nums2)
|
||||
length = len(nums1)
|
||||
return nums1[length//2] if length % 2 == 1 else float(sum(nums1[length//2-1:length//2+1]))/2
|
||||
Reference in new issue
Block a user