C++, Not So Simple (Warning : Just run away, Don't Try This Problem)
\nclass Solution {\npublic:\n    vector<int> func(vector<int> &nums, int k)\n    {\n        vector<int> ret(k, 0);\n        int n=nums.size();\n        for(int 
```\nclass Solution {\npublic:\n    vector<int> func(vector<int> &nums, int k)\n    {\n        vector<int> ret(k, 0);\n        int n=nums.size();\n        for(int i=0; i<nums.size(); i++)\n        {\n            if(ret.empty() || ret.back()>=nums[i])\n            {\n                if(ret.size()<k)\n                    ret.push_back(nums[i]);\n            }\n            else{\n                while(!ret.empty() && n-i>k-ret.size() && ret.back()<nums[i])\n                    ret.pop_back();\n                ret.push_back(nums[i]);\n            }\n        }\n        return ret;\n    }\n    bool isGreater(vector<int> &a, vector<int> &b)\n    {\n        for(int i=0; i<a.size(); i++)\n        {\n            if(b[i]>a[i])\n                return false;\n            else if(b[i]<a[i])\n                return true;\n        }\n        return false;\n    }\n    vector<int> maxNumber(vector<int>& nums1, vector<int>& nums2, int k) {\n        vector<vector<int>> v1, v2;\n        vector<int> ret(k, 0);\n        for(int i=0; i<=k; i++)\n        {\n            if(i>nums1.size() || k-i>nums2.size())\n                continue;\n            vector<int> x, y;\n            if(i)\n                x=func(nums1, i);\n            if(k-i)\n                y=func(nums2, k-i);\n            vector<int> res;\n            int p=0, q=0, m=x.size(), n=y.size();\n            x.push_back(0);\n            y.push_back(0);\n            while(p<m && q<n)\n            {\n                if(x[p]>y[q])\n                    res.push_back(x[p++]);\n                else if(x[p]<y[q])\n                    res.push_back(y[q++]);\n                else\n                {\n                    bool flag=true;\n                    int t=1;\n                    while(p+t<m && q+t<n && x[p+t]==y[q+t])\n                        t++;\n                    if(p+t>=m || (q+t<n && x[p+t]<y[q+t]))\n                        flag=false;\n                    if(flag)\n                        res.push_back(x[p++]);\n                    else\n                        res.push_back(y[q++]);\n                }\n            }\n            while(p<m)\n                res.push_back(x[p++]);\n            while(q<n)\n                res.push_back(y[q++]);\n            if(isGreater(res, ret))\n                ret=res;\n        }\n        return ret;\n    }\n};\n\n```
['C']