K largest subset sums problem

What would be your approach for the below problem?

Given, an array of n elements and a integer k, find the k largest subset sums of the array.
1 <= n <= 10^5
-10^9 <= element[i] <= 10^9
1 <= k <= min(2000, 2^N)

It seemed a greedy problem to me after seeing the constraint for k. I was thinking of maintaining two heaps and generating these k subsets sums in k iteration. But couldn't come up with a proper utilization.

Comments (2)