java 100% 4ms
\nclass Solution {\n    //\u6838\u5FC3\u5C31\u662F\u4E24\u4E2A\u6307\u9488\uFF0C\u4F9D\u6B21\u5BF9\u6BD4\uFF0C\u5728\u6EE1\u8DB3canSkip\u60C5\u51B5\u4E0B\uFF0C\
```\nclass Solution {\n    //\u6838\u5FC3\u5C31\u662F\u4E24\u4E2A\u6307\u9488\uFF0C\u4F9D\u6B21\u5BF9\u6BD4\uFF0C\u5728\u6EE1\u8DB3canSkip\u60C5\u51B5\u4E0B\uFF0C\u627E\u6700\u5927\u7684\u503C\u3002\u96BE\u70B9\u662F\u5982\u679C\u6700\u5927\u503C\u76F8\u540C\uFF0C\u5219\u9700\u8981\u8FED\u4EE3\u5904\u7406\u3002\n    public int[] maxNumber(int[] nums1, int[] nums2, int k) {\n        //canSkip : \u6700\u591A\u53EF\u4EE5\u8DF3\u8FC7\u591A\u5C11\u4E2A\n        int canSkip = nums1.length - 0 + nums2.length - 0 - k;\n        return helper(nums1, 0, nums2, 0, k, canSkip, 1).result;\n    }\n    //\u6700\u540E\u4E00\u4E2A\u53C2\u6570ifSameThenWhich\u8868\u793A\u4E24\u8005\u7686\u53EF\u9009\u7684\u60C5\u51B5\u4E0B\uFF0C\u9009\u62E9\u54EA\u4E2A1\u8868\u793A\u9009\u7B2C\u4E00\u4E2A\u6570\u7EC4\uFF0C2\u8868\u793A\u9009\u7B2C\u4E8C\u4E2A\u6570\u7EC4\u3002\n    public ResultInfo helper(int[] nums1, int start1, int[] nums2, int start2, int k, int canSkip, int ifSameThenWhich) {\n        int[] result = new int[k];\n        for (int index = 0; index < k; index++) {\n            int max1Index = maxWithSkip(nums1, start1, canSkip);\n            int max2Index = maxWithSkip(nums2, start2, canSkip);\n            if (max1Index != -1 && max2Index != -1 && nums1[max1Index] > nums2[max2Index] || max1Index != -1 && max2Index == -1) {//\u7B2C\u4E00\u4E2A\u6570\u7EC4\u7684\u5927\uFF0C\u9009\u7B2C\u4E00\u4E2A\u6570\u7EC4\n                result[index] = nums1[max1Index];\n                canSkip = canSkip - (max1Index - start1);\n                start1 = max1Index + 1;\n            } else if (max1Index != -1 && max2Index != -1 && nums2[max2Index] > nums1[max1Index] || max2Index != -1 && max1Index == -1) {//\u7B2C\u4E8C\u4E2A\u6570\u7EC4\u7684\u5927\uFF0C\u9009\u7B2C\u4E8C\u4E2A\u6570\u7EC4\n                result[index] = nums2[max2Index];\n                canSkip = canSkip - (max2Index - start2);\n                start2 = max2Index + 1;\n            } else {//\u4E24\u503C\u76F8\u7B49\uFF0C\u5219\u5047\u8BBE\u90091\u6216\u90092\u540E\u7EED\u503C\u6BD4\u8F83\n                boolean done = false;\n                int newK = k - index - 1;//\u8FD8\u5269\u591A\u5C11\u4E2A\u6CA1\u9009\n                int newStart1 = max1Index + 1;//\u5047\u8BBE\u90091\u52191\u65B0\u7684start1\u4E3AnewStart1\n                int canSkip1 = canSkip - (max1Index - start1);//\u5047\u8BBE\u90091\u52191\u65B0\u7684canSkip\u4E3AcanSkip1\n                int newStart2 = max2Index + 1;//\u5047\u8BBE\u90092\u52192\u65B0\u7684start2\u4E3AnewStart2\n                int canSkip2 = canSkip - (max2Index - start2);//\u5047\u8BBE\u90092\u52192\u65B0\u7684canSkip\u4E3AcanSkip2\n                ResultInfo resultInfo1 = new ResultInfo(null, newStart1, start2, canSkip1);\n                ResultInfo resultInfo2 = new ResultInfo(null, start1, newStart2, canSkip2);\n                for (int tmpK = 1; tmpK <= newK; tmpK++) {//\u6CE8\u610F\u4F18\u5316\uFF1A\u6BCF\u6B21\u53EA\u8BA1\u7B97\u957F\u5EA6\u4E3A1\u7684\u6570\u7EC4\uFF0C\u5982\u679C\u76F8\u540C\uFF0C\u518D\u8BA1\u7B97\u540E\u9762\u7684\n                    //\u5047\u8BBE\u90091\n                    resultInfo1 = helper(nums1, resultInfo1.start1, nums2, resultInfo1.start2, 1, resultInfo1.canSkip, 1);\n                    int result1 = resultInfo1.result[0];\n                    //\u5047\u8BBE\u90092\n                    resultInfo2 = helper(nums1, resultInfo2.start1, nums2, resultInfo2.start2, 1, resultInfo2.canSkip, 2);\n                    int result2 = resultInfo2.result[0];\n                    if (result1 > result2) {\n                        //\u90091\n                        result[index] = nums1[max1Index];\n                        canSkip = canSkip - (max1Index - start1);\n                        start1 = max1Index + 1;\n                        done = true;\n                        break;\n                    } else if (result1 < result2) {\n                        //\u90092\n                        result[index] = nums2[max2Index];\n                        canSkip = canSkip - (max2Index - start2);\n                        start2 = max2Index + 1;\n                        done = true;\n                        break;\n                    }\n                }\n                if (!done) {//\u90FD\u884C\uFF0C\u6839\u636EifSameThenWhich\u9009\n                    if (ifSameThenWhich == 1) {\n                        result[index] = nums1[max1Index];\n                        canSkip = canSkip - (max1Index - start1);\n                        start1 = max1Index + 1;\n                    } else {\n                        result[index] = nums2[max2Index];\n                        canSkip = canSkip - (max2Index - start2);\n                        start2 = max2Index + 1;\n                    }\n                }\n            }\n        }\n        return new ResultInfo(result, start1, start2, canSkip);\n    }\n    //\u5728\u6EE1\u8DB3canSkip\u6761\u4EF6\u4E0B\uFF0C\u627E\u6700\u5927\u503C\u3002\n    public int maxWithSkip(int[] nums, int start, int canSkip) {//\u8FD4\u56DE\u6700\u5927\u503C\u4E0B\u6807\n        if (start == nums.length) {\n            return -1;\n        }\n        int index = start;\n        for (int i = 1; i <= canSkip; i++) {\n            if (start + i < nums.length && nums[start + i] > nums[index]) {\n                index = start + i;\n            }\n        }\n        return index;\n    }\n}\nclass ResultInfo {//\u7ED3\u679C\u548C\u7ED3\u675F\u65F6\u7684\u72B6\u6001\u503C\uFF0C\u5176\u4E2D\u72B6\u6001\u503C\u7528\u4E8E\u8FED\u4EE3\u4F18\u5316\n    int[] result;\n    int start1;\n    int start2;\n    int canSkip;\n\n    public ResultInfo(int[] result, int start1, int start2, int canSkip) {\n        this.result = result;\n        this.start1 = start1;\n        this.start2 = start2;\n        this.canSkip = canSkip;\n    }\n}\n```
[]