Two easy way: sorting and priority queue.
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```C++ []\n//Using priority queue.\nclass Solution {\npublic:\n    vector<int> maxSubsequence(vector<int>& nums, int k) {\n        priority_queue<int, vector<int>, greater<int>> pq;\n        \n        for(int& num:nums){\n            pq.push(num);\n            if(pq.size()>k)\n                pq.pop();\n        }\n        unordered_map<int,int> um;\n        vector<int> ret;\n        while(!pq.empty()){\n            um[pq.top()]++;\n            pq.pop();\n        }\n\n        for(int& num:nums){\n            if(um.find(num)!=um.end() && um[num]-->0)\n                ret.push_back(num);\n        }\n        \n        return ret;\n    }\n\n};\n```\n``` C++ []\n//Using Sorting\nclass Solution {\npublic:\n    vector<int> maxSubsequence(vector<int>& nums, int k) {\n        vector<int> l=nums;\n        unordered_map<int,int> um;\n        sort(l.begin(),l.end(),greater<int>());\n        \n        for(int i=0;i<k;i++)\n            um[l[i]]++;\n        \n        l.clear();\n        \n        for(int& num:nums){\n            if(um.find(num)!=um.end() && um[num]-->0)\n                l.push_back(num);\n        }\n        \n        return l;\n    }\n\n};\n\n\n```
['Sorting', 'Heap (Priority Queue)', 'C++']