Java solution using min heap
Derived from : https://leetcode.com/problems/find-the-k-sum-of-an-array/discuss/2457384/Priority-Queue-oror-C%2B%2B\n\n\n/*\n\n-> Find max sum possible, we get 
Derived from : https://leetcode.com/problems/find-the-k-sum-of-an-array/discuss/2457384/Priority-Queue-oror-C%2B%2B\n\n```\n/*\n\n-> Find max sum possible, we get max sum after adding all elements greater than or equal to zero\n-> For finding second max sum we can either subtract smallest positive number from sum or add largest negative number to sum\n-> Add or subtract numbers from current sum to get next largest sum\n-> Hack : We can convert all negative numbers to positive and then simply subtract them instead of adding\n-> Apply include/exclude method to generate subsequences\n\nTC : O(len*log(len) + klogk)\nSC : O(k)\n\n*/\n\nclass Solution {\n    public long kSum(int[] nums, int k) {\n        int len = nums.length;\n        int absNums[] = new int[len];\n        long maxSum = 0;\n        \n        for(int idx=0;idx<len;idx++){\n            int num = nums[idx];\n            if(num>=0) maxSum+=num;\n            absNums[idx] = Math.abs(num);\n        }\n        \n        Arrays.sort(absNums);\n        PriorityQueue<Pair> minHeap = new PriorityQueue();\n        List<Long> sumsList = new ArrayList();\n        \n        minHeap.add(new Pair(absNums[0],0));\n        sumsList.add(maxSum);\n        \n        while(minHeap.size()>0&&sumsList.size()<k){\n            Pair pair = minHeap.remove();\n            long sumSoFar = pair.sumSoFar;\n            int idx = pair.idx;\n            \n            sumsList.add(maxSum-sumSoFar);\n            \n            if(idx+1<len){\n                minHeap.add(new Pair(sumSoFar+absNums[idx+1],idx+1));\n                minHeap.add(new Pair(sumSoFar+absNums[idx+1]-absNums[idx],idx+1));\n            }\n        }\n        \n        return sumsList.get(k-1);\n    }\n    \n    private class Pair implements Comparable<Pair>{\n        private long sumSoFar;\n        private int idx;\n        \n        Pair(long sumSoFar,int idx){\n            this.sumSoFar = sumSoFar;\n            this.idx = idx;\n        }\n        \n        public int compareTo(Pair other){\n            if(this.sumSoFar>=other.sumSoFar) return 1;\n            return -1;\n        }\n    }\n}\n```\n\nUpvote if you like my codes !
['Greedy', 'Heap (Priority Queue)', 'Java']