Find the Kth Smallest Sum of a Matrix With Sorted Rows
Merge the sorted rows one at a time, keeping only the k smallest sums in a heap of (sum, prefix, column) entries.
Merge the sorted rows one at a time, keeping only the k smallest sums in a heap of (sum, prefix, column) entries.