I used optimization introduced in [2] and the merge method introduced in [1].

To summarize:

We can find the max number with length X (named maxNumLenX) from an array nums using stack method. [1][2]

Based on maxNumLenX, we can find max numbers with length of X-1, X-2, ..., 1. [2].

Based on 1. and 2., we can solve the problem like this:
a. Find maxNum2 with max possible length from nums2.
b. Find all max numbers with less length to the min possible length.
c. Try maxNum1 with every possible length, starting from the max possible length; Directly fetch the corresponding maxNum2 (maxNum1.length + maxNum2.length ==k), merge them and generate the results.
d. When generating maxNum1 with length X in the loop, we can generate it from maxNum1 with length X+1.