[leetcode-4] Median of Two Sorted Arrays
ยท
๐Ÿข One step
LeetCode-4 Median of Two Sorted Arrays : Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. note : The overall run time complexity should be O(log (m+n)).Answer :::python class Solution: def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float: p = nums1 + nums2 p.sort() if len(p)%2!=0: median = p[len(p)//2] else..
๋‹คํ–ˆ๋‹ค
'4' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก