the Basic/traditional DP solution?
Tips: Also this is not the final solution, As you need change the int to string , to solve the integer overload issue. but i think this is the basic DP. thanks 
Tips: Also this is not the final solution, As you need change the int to string , to solve the integer overload issue.
but i think this is the basic DP. thanks

DP[m][i][j] means the largest value when select m elements from A[0]-A[i] and B[0]- B[j] 

Init:
DP[m][0][j] >> seleect 0-m  from  B[0]- B[j] 
DP[m][i][0] >>seleect 0-m  from  A[0]- A[i] 

DP:
DP[m][i][j] = Max(
	                                   ++++ did not inlcude [i][j] in m elements+++++
			              res[m][i][j-1];                                              >> select m elements from [i][j-1]
										res[m][i-1][j];                                             >> select m elements from [i-1][j]
										                   ++++ inlcude [i][j] in m elements+++++                                            
										res[m-1][i-1][j]*10+nums1[i-1];                >> end with nums1[i-1]
										res[m-1][i][j-1]*10+nums2[j-1];
										nums1[i-1]*10^m-1+res[m-1][0][j];         >> start with nums1[i-1]
										nums2[j-1]*10^m-1+res[m-1][i][0];
)
'''
class Solution {
public:
    vector<int> maxNumber(vector<int>& nums1, vector<int>& nums2, int k) {
        
        int len1 = nums1.size();
        int len2 = nums2.size();
        
        vector<vector<vector<int> > > res (k+1,vector<vector<int>>(len1+1,vector<int>(len2+1,0)));
        
        
        for(int m=1;m<=k;m++)
        {
                for(int j =1;j<=len2;j++)
                {
                    if(j >=m)
                    {
                        res[m][0][j] = max(res[m][0][j-1],res[m-1][0][j-1]*10+nums2[j-1]);
                    }
                }
        }
        
        for(int m=1;m<=k;m++)
        {
                for(int i =1;i<=len1;i++)
                {
                    if(i >=m)
                    {
                        res[m][i][0] = max(res[m][i-1][0],res[m-1][i-1][0]*10+nums1[i-1]);
                    }
                }
        }
        
        for(int m=1;m<=k;m++)
        {
            for(int i=1; i<=len1;i++)
            {
                for(int j =1;j<=len2;j++)
                {
                    if(i+j >=m)
                    {
                        vector<int> tmp;
                        tmp.push_back(res[m][i][j-1]);
                        tmp.push_back(res[m][i-1][j]);
                        
                        tmp.push_back(res[m-1][i-1][j]*10+nums1[i-1]);
                        tmp.push_back(res[m-1][i][j-1]*10+nums2[j-1]);
                        
                        int dl = 0;
                        int dt = 0;
                        for(int p=0;p<m-1;p++)
                        {
                           dl = nums1[i-1]*10;
                           dt = nums2[j-1]*10;
                        }
                        tmp.push_back(dl+res[m-1][0][j]);
                        tmp.push_back(dt+res[m-1][i][0]);
                        
                        sort(tmp.begin(),tmp.end());
                        res[m][i][j] = tmp[tmp.size()-1];
                    }
                }
                   
            }
        }
        
        int ans = res[k][len1][len2];
        vector<int> data;
        while(ans!=0)
        {
            data.push_back(ans%10);
            ans =ans/10;
        }
        reverse(data.begin(),data.end());
        return data;
    }
};
'''
[]