题解 | #在两个长度相等的排序数组中找到上中位数#
在两个长度相等的排序数组中找到上中位数
http://www.nowcoder.com/practice/6fbe70f3a51d44fa9395cfc49694404f
class Solution: def findMedianinTwoSortedAray(self , arr1 , arr2 ): # write code here p1, p2 = 0, 0 ans = 0 for i in range(len(arr1)): if arr1[p1] <= arr2[p2]: ans = arr1[p1] p1 += 1 else: ans = arr2[p2] p2 += 1 return ans