Each row and each column of an n×n matrix is sorted ascending. Return the k-th smallest element in sorted order (not the k-th distinct value).
Input
n n — the matrix dimensionskOutput: the k-th smallest element.
3 3 1 5 9 10 11 13 12 13 15 8
13
Sorted: 1 5 9 10 11 12 13 13 15 — the 8th is 13.
1 1 -5 1
-5
Run your code against the sample tests, or Submit to run the full suite.