首页 > 编程语言 > 详细

【leetcode?python】 88. Merge Sorted Array

时间:2016-10-31 21:09:48      阅读:185      评论:0      收藏:0      [点我收藏+]

class Solution(object):
    def merge(self, nums1, m, nums2, n):
        """
        :type nums1: List[int]
        :type m: int
        :type nums2: List[int]
        :type n: int
        :rtype: void Do not return anything, modify nums1 in-place instead.
        """
        tag=len(nums1)
        while tag>m:
            nums1.pop()
            tag-=1
        nums1.extend(nums2[0:n])
        nums1.sort()
       

【leetcode?python】 88. Merge Sorted Array

原文:http://www.cnblogs.com/kwangeline/p/6016926.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!