SEAGATE TECHNOLOGY | On Campus OA (2022) | Kth Smallest Element in a Sorted Matrix
Question · Posted Jun 2026
Problem Statement You are given an n × n matrix where: Each row is sorted in ascending order. Each column is sorted in ascending order. Your task is to find the kth smallest element in the matrix. Note that it is the kth smallest element in the sorted order of all elements, not the kth distinct element. The solution should use only O(n) extra space. Example 1 Input matrix = [ [1,5,9], [10,11,13], [12,13,15] ] k = 8 Output 13 ...
The full answer & interview discussion are available to premium members.
Log in Create a free account