Heap soultion [EXPLAINED]
IntuitionWe want the k-th largest sum from all possible subsequences of an array. To do this efficiently, we focus on maintaining the largest sums dynamically u
# Intuition
We want the k-th largest sum from all possible subsequences of an array. To do this efficiently, we focus on maintaining the largest sums dynamically using a priority queue, avoiding the need to generate all subsequences explicitly.

# Approach
Sort the array by absolute values, calculate the maximum sum using positives, and use a priority queue to simulate extracting the k largest sums efficiently.
This solution uses a heap (priority queue) to efficiently manage and extract the k largest subsequence sums. In Python, this is implemented using the heapq module, which provides a min-heap by default. By pushing negative values into the heap, we simulate a max-heap behavior.

# Complexity
- Time complexity:
O(k log k + n log n) due to sorting and managing the priority queue.

- Space complexity:
O(k) for the priority queue.

# Code
```python3 []
class Solution:
    def kSum(self, nums: list[int], k: int) -> int:
        # Calculate the maximum sum using all positive numbers
        max_sum = sum(x for x in nums if x > 0)
        # Convert all numbers to their absolute values for easier processing
        nums = sorted(abs(x) for x in nums)

        # Priority queue to track the largest sums (negative for max-heap simulation)
        pq = [(-max_sum, 0)]
        
        # Variable to store the current kth largest sum
        result = max_sum

        # Extract the kth largest sum
        for _ in range(k):
            # Pop the largest sum from the priority queue
            result, index = heappop(pq)
            result = -result  # Convert back to positive

            # If possible, add the next subsequence sums to the priority queue
            if index < len(nums):
                heappush(pq, (-(result - nums[index]), index + 1))
                if index > 0:
                    heappush(pq, (-(result - nums[index] + nums[index - 1]), index + 1))

        return result

```
['Sorting', 'Heap (Priority Queue)', 'Python3']