Easy c++ solution with full explanation! | Two stacks with i & k-i sequences!
\nclass Solution {\npublic:\n    vector<int> ans;\n    vector<int> maxNumber(vector<int>& a, vector<int>& b, int k) {\n          for(int i=0; i<=k; i++) {\n    
```\nclass Solution {\npublic:\n    vector<int> ans;\n    vector<int> maxNumber(vector<int>& a, vector<int>& b, int k) {\n          for(int i=0; i<=k; i++) {\n                vector<int> s1 , s2;\n                if(i>0) s1 = getBest(a,i);  // make i length lexographically biggest sequence possible from stack 1 \n                if(k-i>0) s2 = getBest(b,k-i); // make k-i length lexographically biggest sequence from stack 2\n                vector<int> s3;\n                int m = 0 , n = 0;\n                \n                // take the element from corresponding stack is is lexographically bigger!\n                while(m<s1.size() && n<s2.size()) s3.push_back((cmp(s1,s2,m,n) ? s1[m++] : s2[n++]));\n                \n                while(m<s1.size()) s3.push_back(s1[m++]);\n                while(n<s2.size()) s3.push_back(s2[n++]);\n                \n                if(s3.size()==k) ans=max(ans,s3);\n          }\n         return ans;\n    }\n    bool cmp(vector<int>&a,vector<int>&b,int i,int j) {\n         while(i<a.size() && j<b.size() && a[i]==b[j]) i++,j++;\n         return (j==b.size() || ((i<(int)a.size()) && (a[i] > b[j])));\n    }\n    vector<int> getBest(vector<int> &a,int k) {\n        vector<int> stk;\n        int n = a.size();\n        for(int i=0; i<a.size(); i++) {\n             // a bigger element is present than current maximum & you can make a sequence >= k !\n             while(!stk.empty() && stk.back() < a[i] && (((int)stk.size() - 1) + (n - i)) >=k) stk.pop_back();\n             stk.push_back(a[i]);\n        }\n        while(stk.size() > k) stk.pop_back();\n        return stk;\n    }\n};\n```
[]