def maxNumber(self, nums1, nums2, k):
    '\n        :type nums1: List[int]\n        :type nums2: List[int]\n        :type k: int\n        :rtype: List[int]\n        '

    def prep(nums, k):
        dr = (len(nums) - k)
        stay = []
        for num in nums:
            while (dr and stay and (stay[(- 1)] < num)):
                stay.pop()
                dr -= 1
            stay.append(num)
        return stay[:k]

    def merge(x, y):
        return [max(x, y).pop(0) for _ in (x + y)]
    l1 = len(nums1)
    l2 = len(nums2)
    r = [0]
    for i in range((k + 1)):
        if ((i <= l1) and ((k - i) <= l2)):
            r = max(merge(prep(nums1, i), prep(nums2, (k - i))), r)
    return r
:type nums1: List[int]
:type nums2: List[int]
:type k: int
:rtype: List[int]
def maxNumber(self, nums1, nums2, k):
    '\n        :type nums1: List[int]\n        :type nums2: List[int]\n        :type k: int\n        :rtype: List[int]\n        '

    def prep(nums, k):
        dr = (len(nums) - k)
        stay = []
        for num in nums:
            while (dr and stay and (stay[(- 1)] < num)):
                stay.pop()
                dr -= 1
            stay.append(num)
        return stay[:k]

    def merge(x, y):
        return [max(x, y).pop(0) for _ in (x + y)]
    l1 = len(nums1)
    l2 = len(nums2)
    r = [0]
    for i in range((k + 1)):
        if ((i <= l1) and ((k - i) <= l2)):
            r = max(merge(prep(nums1, i), prep(nums2, (k - i))), r)
    return r