Priority Queue||C++||Simple Solution||Loaded with comments for better understanding
\nclass Solution {\npublic:\n    // Here the approach is that we want K max right ? so the max value is equal to the sum of the positive integers and after that
```\nclass Solution {\npublic:\n    // Here the approach is that we want K max right ? so the max value is equal to the sum of the positive integers and after that it will      \n    // decrease. So, for decreasing the numbers, we have to add -ve numbers and minus +ve numbers.\n    // Since we have taken abs of the numbers, so we have to subtract only.\n    long long kSum(vector<int>& nums, int k) {\n        long long sum=0,n=nums.size();\n        vector<long long> ans;\n        for(int i=0;i<n;i++){\n            if(nums[i]>=0)\n            sum+=nums[i];   // Max possible sum obtained from numbers\n            nums[i]=abs(nums[i]);\n        }\n        sort(nums.begin(),nums.end());\n        ans.push_back(sum); //pushing max val i.e. sum of positive integers\n        priority_queue<pair<long long,int>> pq;\n        pq.push({sum-nums[0],0});\n        while(ans.size()<k){\n            auto p=pq.top();\n            pq.pop();\n            if((p.second+1)<n){\n               pq.push({p.first-nums[p.second+1],p.second+1});//Subtract nextIndex\n               pq.push({p.first+nums[p.second]-nums[p.second+1],p.second+1});// Subtract nextIndex and add current Index\n            }\n            ans.push_back(p.first); // add max val\n        }\n        return ans.back();\n    }\n};\n```\nHappy Coding ;-)
['C', 'Heap (Priority Queue)']