BFS Runtime: 112 ms, faster than 100.00% Current Python
Runtime: 112 ms, faster than 100.00%\nMemory Usage: 14.4 MB, less than 63.64%\n# Explanation:\nLet N1 be the lenghth of nums1, and N2 the length of nums2.\nThe 
Runtime: 112 ms, faster than 100.00%\nMemory Usage: 14.4 MB, less than 63.64%\n# Explanation:\nLet N1 be the lenghth of nums1, and N2 the length of nums2.\nThe `remain` is initialized to `k`, and reduced by 1 after choosed a candidate every time.\n\nThe 1st candidate must be in `nums1[0:min(len(nums1), max_skip+1)]` and `nums2[0:min(len(nums2), max_skip+1)]`, and the `max_skip` is the max number we can drop which equal to `N1 + N2 - remain`.\n\nAsume we get the 1st number at index `i1` in nums1.\nThe 2nd candidate must be in `nums1[i1+1:min(len(nums1), i1+1+max_skip+1)]` and `nums2[0:min(len(nums2), max_skip+1)]`. the `max_skip` is `N1-i1+N2-0-remain`\n....\nThe (k+1)th candidate must be in `nums1[i1+1:min(len(nums1), i1+1+max_skip+1)]` and `nums2[i2+1:min(len(nums2), i2+1+max_skip+1)]`. the `max_skip` is `N1-i1+N2-i2-remain`\n\nFor each level (represented by remain), we can we choose the best value for the current number.\n\nI hope this solution can help you.\n```\nclass Solution:\n    def maxNumber(self, nums1: [int], nums2: [int], k: int) -> [int]:\n        N1 = len(nums1)\n        N2 = len(nums2)\n\n        def _get_candidate(nums, start, max_skip):\n            j = start\n            v = -1\n            for i in range(start, min(len(nums), start+max_skip+1)):\n                if v < nums[i]:\n                    j = i\n                    v = nums[j]\n                    if nums[j] == 9:break\n            return j,v\n        \n        next_candidates = {(0,0)}\n        ret = [0]*k\n        for remain in range(k,0,-1):\n            candidates = next_candidates\n            next_candidates = set()\n            value_max = -1\n            for (i1,i2) in candidates:\n                if i1 >= N1 and i2 >= N2: continue\n                r1 = N1 - i1\n                r2 = N2 - i2\n                max_skip = r1 + r2 - remain\n\n                j1,v1 = _get_candidate(nums1, i1, max_skip)\n                j2,v2 = _get_candidate(nums2, i2, max_skip)\n\n                if v1 > value_max:\n                    next_candidates = {(j1+1, i2)}\n                    value_max = v1\n                elif v1 == value_max:\n                    next_candidates.add((j1+1, i2))\n                \n                if v2 > value_max:\n                    next_candidates = {(i1, j2+1)}\n                    value_max = v2\n                elif v2 == value_max:\n                    next_candidates.add((i1, j2+1))\n            ret[-remain] = value_max\n            \n        return ret\n```
[]