You are given an n × n matrix matrix where each row and each column is sorted in ascending order. Given an integer k, return the kth smallest element in the matrix. The kth smallest element is the element that would appear at position k when all elements of the matrix are arranged in sorted order.
Topics
Companies
Articles
Examples:
N/A
Constraints:
1 = n = 300
-10? = matrix[i][j] = 10?
1 = k = n × n
Companies:
Amazon
Topics:
Binary Search
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.
Access Restricted: Please Login to access the code editor and test cases.