C# faster than 75%, less then 100% Mem
Runtime: 316 ms\nMemory Usage: 32.1 MB\n\nWhat helped me was thinking in therms of elements that needed to be removed.\nSay you have 4 elements to remove to get
Runtime: 316 ms\nMemory Usage: 32.1 MB\n\nWhat helped me was thinking in therms of elements that needed to be removed.\nSay you have 4 elements to remove to get to a total size of k.\nYou can remove 0 from nums1 and 4 to nums2 or 1-3, 2-2, 3-1 or 4-0.\nThen at each stage just merge the trimmed arrays taking care of the equal case (see code). Compare the resulting arrays to find the biggest number.\n\n```\n    public int[] MaxNumber(int[] nums1, int[] nums2, int k) \n    {\n        nums1 = Trim(nums1, k);\n        nums2 = Trim(nums2, k);        \n        \n        int dif = (nums1.Length + nums2.Length) - k;\n\n        if (dif == 0)\n        {\n            return Merge(nums1, nums2, k);\n        }\n       \n        int[] new1;\n        int[] new2;\n        int[] crnt;\n        int[] biggest = null;\n\n        for (int i = dif, j = 0; i >= 0; i--, j++)\n        {\n            if (nums1.Length < i || nums2.Length < j) { continue; }\n\n            new1 = Trim(nums1, nums1.Length - i);\n            new2 = Trim(nums2, nums2.Length - j);\n\n            crnt = Merge(new1, new2, k);\n\n            if (biggest == null) \n            { \n                biggest = crnt; \n            }\n            else\n            {\n                for (int s = 0; s < k; s++)\n                {\n                    if (biggest[s] < crnt[s]) { biggest = crnt; break; }\n                    else if (biggest[s] > crnt[s]) { break; }\n                }\n            }\n        }\n\n        return biggest;\n    }\n    \n    private int[] Merge(int[] nums1, int[] nums2, int k)\n    {\n        int[] result = new int[k];\n\n        int i = 0;\n        int j = 0;\n        int p = 0;\n\n        int h;\n        int g;\n\n        while (i < nums1.Length && j < nums2.Length)\n        {\n            if (nums1[i] > nums2[j])\n            {\n                result[p++] = nums1[i++];\n            }\n            else if (nums1[i] < nums2[j])\n            {\n                result[p++] = nums2[j++];\n            }\n            else\n            {\n                //find next non equal pair.\n                h = i + 1;\n                g = j + 1;\n                while (h < nums1.Length && g < nums2.Length && nums1[h] == nums2[g])\n                {\n                    h++; g++;\n                }\n\n                if (h == nums1.Length) { result[p++] = nums2[j++]; }\n                else if (g == nums2.Length) { result[p++] = nums1[i++]; }\n                else if (nums1[h] > nums2[g]) { result[p++] = nums1[i++]; }\n                else { result[p++] = nums2[j++]; }\n            }\n        }\n\n        while (i < nums1.Length)\n        {\n            result[p++] = nums1[i++];\n        }\n\n        while (j < nums2.Length)\n        {\n            result[p++] = nums2[j++];\n        }\n\n        return result;\n    }\n         \n    private int[] Trim(int[] nums, int k)\n    {\n        if (nums.Length <= k) { return nums; }\n        \n        int rem = nums.Length-k;\n       \n        Stack<int> stack = new Stack<int>();\n        \n        for(int i=0; i< nums.Length; i++)\n        {\n            if (stack.Count == 0 || rem == 0) { stack.Push(nums[i]); }\n            else\n            {\n                while(stack.Count > 0 && stack.Peek() < nums[i] && rem > 0)\n                {\n                    stack.Pop();\n                    rem--;\n                }\n                stack.Push(nums[i]);\n            }\n        }\n        \n        while (rem > 0) {  stack.Pop(); rem--;  }\n        \n        int[] result = new int[k];\n        int j = k-1;\n        while(stack.Count > 0)\n        {\n            result[j] = stack.Pop();\n            j--;\n        }\n        \n        return result;\n    }
[]