matrix has every row sorted and every column sorted in increasing order. Return the k-th smallest value (counting from 1, repeated values counted separately).
For [[1, 5, 9], [10, 11, 13], [12, 13, 15]] and k = 8 the answer is 13.
Example 1
Input:
kth_smallest_matrix([[1, 5, 9], [10, 11, 13], [12, 13, 15]], 8)
Output:
13
Example 2
Input:
kth_smallest_matrix([[-5]], 1)
Output:
-5
1 <= rows, cols <= 3001 <= k <= rows * cols-10**9 <= value <= 10**9No results yet
Run your code to check it against the examples, or submit to run every test.