Skip to content

Commit e581ed4

Browse files
committed
day-6
1 parent b961d52 commit e581ed4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

median-of-two-sorted-arrays.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:
3+
nums3 = nums1 + nums2
4+
nums3.sort()
5+
6+
if len(nums3) %2 == 1:
7+
return nums3[((len(nums3)+1)//2)-1]
8+
else:
9+
return (nums3[(len(nums3)//2)-1]+nums3[(len(nums3)+1)//2])/2
10+

0 commit comments

Comments
 (0)