AlgoMaster Logo

Kth Smallest Element in Sorted Matrix

matrix=[[1,5,9],[10,11,13],[12,13,15]],k=8
0 / 36
k = 8159101113121315count cells ≤ mid in O(n), then shrink the value range
algomaster.io
Step:Binary search on the answer's value, not its index