题解 | #在两个长度相等的排序数组中找到上中位数#

在两个长度相等的排序数组中找到上中位数

http://www.nowcoder.com/practice/6fbe70f3a51d44fa9395cfc49694404f

write code here

class Solution:
def findMedianinTwoSortedAray(self , arr1 , arr2 ):
    for i in arr2:
        arr1.append(i)
    arr1.sort()
    length = len(arr1)
    if(length&1):
        n = length//2 + 1
    else:
        n = length//2
    return arr1[n-1]
全部评论

相关推荐

用微笑面对困难:你一定很懂劳务法 是不是因为这个hr不敢要
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务