simple and easy C++ solution || Sorting
\n# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n###### Let\'s Connect on Linkedin: www.linkedin.com/in/shishirrsiam\n\n\n\n\n# Code\ncpp []\nclass Solut
\n# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n###### Let\'s Connect on Linkedin: www.linkedin.com/in/shishirrsiam\n\n\n\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    vector<int> maxSubsequence(vector<int>& nums, int k) \n    {\n        int n = nums.size();\n        vector<pair<int, int>> vec;\n        for(int i = 0; i < n; i++)\n            vec.push_back({nums[i], i});\n\n        unordered_set<int>store;\n        sort(rbegin(vec), rend(vec));\n\n        for(auto [val, idx] : vec)\n        {\n            if(!k--) break;\n            store.insert(idx);\n        }\n\n        vector<int>ans;\n        for(int i = 0; i < n; i++)\n            if(store.count(i)) ans.push_back(nums[i]);\n\n        return ans;\n    }\n};\n```
['Array', 'Hash Table', 'Sorting', 'C++']