Coding · Hard · Pro
Kth smallest element in a row-wise and column-wise sorted matrix
CodingBinary SearchStaff
Approach
- Binary search the value space between matrix min and max.
- For candidate value, count how many elements are ≤ value (walk from top-right).
- Adjust lo/hi until the kth smallest…