from typing import List


class Solution:
    def merge(self, nums1: List[int], m: int, nums2: List[int], n: int) -> None:
        """
        Do not return anything, modify nums1 in-place instead.
        """
        iterator = 0
        nums1 = nums1[:m]
        nums2 = nums2[:n]
        while nums2:
            try:
                if nums1[iterator] >= nums2[0]:
                    nums1.insert(iterator, nums2[0])
                    nums2.pop(0)
                iterator += 1
            except IndexError:
                nums1 += nums2
                break
        print(nums1)


sl = Solution()
sl.merge([1, 2, 3, 0, 0, 0], 3, [2, 5, 6], 3)
