Median of Two Sorted Arrays
这题https://oj.leetcode.com/problems/median-of-two-sorted-arrays/
1
2
3
4
5
6
C=sorted(A+B)
l = len(C)
if l%2==0:
return float(C[l/2-1]+C[l/2])/2
else:
return C[l/2]
Runtime: 133 ms
This post is licensed under CC BY 4.0 by the author.