87% faster: c++
\nclass Solution {\npublic:\n    vector<int> maxSubsequence(vector<int>& nums, int k) {\n        vector<int> temp = nums;\n        sort(temp.begin(), temp.end()
```\nclass Solution {\npublic:\n    vector<int> maxSubsequence(vector<int>& nums, int k) {\n        vector<int> temp = nums;\n        sort(temp.begin(), temp.end(), greater<int>());\n        \n        map<int,int> greaterElements;\n        for(int i=0; i<k; i++){\n            greaterElements[temp[i]]++;\n        }\n        \n        vector<int> result;\n        \n        for(int i=0; i<nums.size(); i++){\n            auto itr = greaterElements.find(nums[i]);\n            if(itr != greaterElements.end() and itr->second>0){\n                result.push_back(nums[i]);\n                itr->second--;\n            }\n                     \n        }\n        return result;\n    }\n};\n```
[]