You are given an mat where each row is sorted in nondecreasing order, and an integer k.
You can select exactly one element from each row to form a combination. The sum of a combination is the total of its chosen elements.
Return the
Constraints:
m == mat.length
n == mat[i].length
m, n
mat[i][j]
k
mat[i] is sorted in nondecreasing order.
You are given an mat where each row is sorted in nondecreasing order, and an integer k.
You can select exactly one element from each row to form a combination. The sum of a combination is the total of its chosen elements.
Return the
Constraints:
m == mat.length
n == mat[i].length
m, n
mat[i][j]
k
mat[i] is sorted in nondecreasing order.