k
times:
a. Pop the smallest sum from the heap.
b. For the popped sum, identify the row that was last incremented.
c. If the next element in that row exists, add a new sum to the heap with the next element included.
d. Ensure that duplicate combinations are not added to the heap by using a set or checking the last added indices.k
iterations, the last popped sum from the heap is the kth
smallest sum.