K largest subset sums

0
Remix

You get n items with non-negative weights. Return the k largest subset sums, in decreasing order (subsets are distinct by the items they contain). Brute force over all subsets is exponential; generate the sums in order with a max-heap.

GoogleTechnical phone screenLast asked Jan 2026
No answer yet. Write the first one; the best answer gets endorsed.