c++ concise solution
code comments itself.\n\ncpp\nclass Solution {\npublic:\n    std::deque<int> getMax(const std::vector<int> &nums, int k)\n    {\n        if(k == 0){\n          
code comments itself.\n\n```cpp\nclass Solution {\npublic:\n    std::deque<int> getMax(const std::vector<int> &nums, int k)\n    {\n        if(k == 0){\n            return {};\n        }\n        \n        std::deque<int> result;\n        const int drop = std::max<int>(0, nums.size() - k);\n\n        for(int d = 0; const auto e: nums){\n            while(!result.empty() && result.back() < e && d < drop){\n                result.pop_back();\n                d++;\n            }\n            result.push_back(e);\n        }\n        \n        while(result.size() > k){\n            result.resize(k);\n        }\n        return result;\n    }\n    \n    std::vector<int> merge(std::deque<int> p, std::deque<int> q)\n    {\n        std::vector<int> result;\n        while(!(p.empty() && q.empty())){\n            if(p > q){\n                result.push_back(p.front());\n                p.pop_front();\n            }\n            else{\n                result.push_back(q.front());\n                q.pop_front();\n            }\n        }\n        return result;\n    }\n    \n    vector<int> maxNumber(vector<int>& nums1, vector<int>& nums2, int k)\n    {\n        std::vector<int> result;\n        for(int i = 0; i <= k && i <= nums1.size(); ++i){\n            if(int j = k - i; j <= nums2.size()){\n                result = std::max(result, merge(getMax(nums1, i), getMax(nums2, j)));\n            }\n        }\n        return result;\n    }\n};\n```
[]