records/08-17/conbine1.py
def merge(self, nums1, m: int, nums2, n: int) -> None:
        """
        Do not return anything, modify nums1 in-place instead.
        """

        if n != 0:
            nums1[m:m + n] = nums2

            def insertation_sort(arr):
                for i in range(len(arr)):
                    pre_idx = i - 1
                    current = arr[i]
                    while pre_idx >= 0 and arr[pre_idx] > current:
                        arr[pre_idx + 1] = arr[pre_idx]
                        pre_idx -= 1

                    arr[pre_idx + 1] = current
                return arr

            nums1[:] = insertation_sort(nums1[:m + n])

        if m == 0:
            nums1[:n] = nums2

        Do not return anything, modify nums1 in-place instead.
        
Do not return anything, modify nums1 in-place instead.
Do not return anything modify nums1 in - place instead .
def merge(self, nums1, m: int, nums2, n: int) -> None:
        if n != 0:
            nums1[m:m + n] = nums2
            def insertation_sort(arr):
                for i in range(len(arr)):
                    pre_idx = i - 1
                    current = arr[i]
                    while pre_idx >= 0 and arr[pre_idx] > current:
                        arr[pre_idx + 1] = arr[pre_idx]
                        pre_idx -= 1
                    arr[pre_idx + 1] = current
                return arr
            nums1[:] = insertation_sort(nums1[:m + n])
        if m == 0:
            nums1[:n] = nums2
def merge ( self , nums1 , m : int , nums2 , n : int ) -> None : if n != 0 : nums1 [ m : m + n ] = nums2 def insertation_sort ( arr ) : for i in range ( len ( arr ) ) : pre_idx = i - 1 current = arr [ i ] while pre_idx >= 0 and arr [ pre_idx ] > current : arr [ pre_idx + 1 ] = arr [ pre_idx ] pre_idx -= 1 arr [ pre_idx + 1 ] = current return arr nums1 [ : ] = insertation_sort ( nums1 [ : m + n ] ) if m == 0 : nums1 [ : n ] = nums2
Do not return anything, modify nums1 in-place instead.
Do not return anything modify nums1 in - place instead .
"""
        Do not return anything, modify nums1 in-place instead.
        """
self
nums1
m
int
nums2
n
int