An Accepted Python Solution
This problem could be divided into 2 sub-problems:\n\n1. function getMax(nums, t):\n\n  get t numbers from list nums to form one single maximized sub-list, with
This problem could be divided into 2 sub-problems:\n\n1. **function getMax(nums, t):**\n\n  get t numbers from list *nums* to form one single maximized sub-list, with relative orders preserved\n\n2. **function merge(nums1, nums2):**\n\n  merge *nums1* and *nums2* to form one single maximized list, with relative orders preserved\n\nThe final result could be solved by enumerate the length of sub-list *nums1* and *nums2*, and record the max merged list.\n\nPython Code:\n\n    class Solution(object):\n        def maxNumber(self, nums1, nums2, k):\n            """\n            :type nums1: List[int]\n            :type nums2: List[int]\n            :type k: int\n            :rtype: List[int]\n            """\n            def getMax(nums, t):\n                ans = []\n                size = len(nums)\n                for x in range(size):\n                    while ans and len(ans) + size - x > t and ans[-1] < nums[x]:\n                        ans.pop()\n                    if len(ans) < t:\n                        ans += nums[x],\n                return ans\n    \n            def merge(nums1, nums2):\n                ans = []\n                while nums1 or nums2:\n                    if nums1 > nums2:\n                        ans += nums1[0],\n                        nums1 = nums1[1:]\n                    else:\n                        ans += nums2[0],\n                        nums2 = nums2[1:]\n                return ans\n            \n            len1, len2 = len(nums1), len(nums2)\n            res = []\n            for x in range(max(0, k - len2), min(k, len1) + 1):\n                tmp = merge(getMax(nums1, x), getMax(nums2, k - x))\n                res = max(tmp, res)\n            return res\n\nRef: [http://bookshadow.com/weblog/2015/12/24/leetcode-create-maximum-number/][1]\n\n\n  [1]: http://bookshadow.com/weblog/2015/12/24/leetcode-create-maximum-number/
['Python']