面试题 10.01. 合并排序的数组leetcode

问题描述

在这里插入图片描述

题解1-拼接+排序

class Solution:
    def merge(self, A: List[int], m: int, B: List[int], n: int) -> None:
        """
        Do not return anything, modify A in-place instead.
        """
        A[m:]=B
        A.sort()

在这里插入图片描述

发布了314 篇原创文章 · 获赞 23 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/weixin_39289876/article/details/104901984