360 ms python solution with detailed explanation
The main idea: \n\n1 . get the maximum array with length of s1 from list nums1 called p1 and then get the maximum array with length of k-s1 from list nums2 call
The main idea: \n\n1 . get the maximum array with length of s1 from list nums1 called p1 and then get the maximum array with length of k-s1 from list nums2 called p2\n2 . arrange p1 and p2 to make maximum rs \n\nTo get the maximum array with length of c_len and also reserve the relative order in that array:\n    We use a helper function to get the maximum array with length of c_len\nas long as ans[-1]< current value and the remaining elements in list nums is enough to form ans with length c_len then we pop the last element in ans\n```\n\nclass Solution(object):\n    def maxNumber(self, nums1, nums2, k):\n        \n        l1,l2 = len(nums1),len(nums2)\n        rs = []\n        \n        \n        def helper(nums,c_len):\n            ans = []\n            ln = len(nums)\n            for idx,val in enumerate(nums):\n                while ans and ans[-1]<val and ln-idx> c_len-len(ans):\n                    ans.pop(-1)\n                if len(ans)<c_len:\n                    ans.append(val)\n            return ans\n        \n        for s1 in range(max(0,k-l2),min(k,l1)+1):\n            p1,p2 = helper(nums1,s1),helper(nums2,k-s1)\n            rs = max(rs,[max(p1,p2).pop(0) for _ in range(k)])\n        return rs\n```\n
[]