C++||easy approach
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```\nclass Solution {\npublic:\n    vector<int> maxSubsequence(vector<int>& nums, int k) \n    {\n        if(nums.size()==k)\n        return nums;\n        priority_queue<pair<int,int>>pq;\n        for(int i=0;i<nums.size();i++)\n        {\n            pq.push(make_pair(nums[i],i));\n        }\n        vector<pair<int,int>>v;\n        while(k--)\n        {\n            v.push_back({pq.top().second,pq.top().first});\n            pq.pop();\n        }\n        sort(v.begin(),v.end());\n        vector<int> ans;\n        for(auto i :v)\n        {\n            ans.push_back(i.second);\n        }\n        return ans;\n    }\n};\n```
['C++']