C++ Easy solution
class Solution {\npublic:\n        \n        #define ll long long\n        #define pp pair\n        \n    long long kSum(vector& A, int k) {\n            \n    
**class Solution {\npublic:\n        \n        #define ll long long\n        #define pp pair<long long, int>\n        \n    long long kSum(vector<int>& A, int k) {\n            \n            int n = A.size();\n            \n            vector<ll> sub;\n            \n            ll mx = 0;\n            \n            \n            for(int i =0; i<n; i++){\n                    \n                    if(A[i]>=0){\n                            mx+=A[i];\n                    } else{\n                            \n                            A[i] = abs(A[i]);\n                    }\n            }\n            \n            sort(A.begin(), A.end());\n            \n            priority_queue<pp ,vector<pp>, greater<pp>> q;\n            \n            q.push({A[0], 0});\n            \n            while(q.size()){\n                    \n                    auto it = q.top(); q.pop();\n                    \n                    ll val = it.first;\n                    int ind = it.second;\n                    \n                    sub.push_back(val);\n                    \n                    if(sub.size()>=k-1) break;\n                    \n                    if(ind<n-1){\n                            \n                            q.push({val+(ll)A[ind+1], ind+1});\n                            q.push({(ll)A[ind+1]+(val-(ll)A[ind]), ind+1});\n                    }\n            }\n            \n            vector<ll> ans;\n            ans.push_back(mx);\n            \n            for(int i =0; i<sub.size(); i++){\n                    ans.push_back(mx-sub[i]);\n            }\n            \n          return ans[k-1];\n    }\n};**\n\nExplantion\n\nwe need find max sum (that is greatest) from array so 1st we add all positive number. Then whatt will be the next greatest Number so for this I need to subtract abs(-ve Num) or smallest positive number.
['C', 'Heap (Priority Queue)']