Find kth largest element from a 2-d sorted array

Problem Given the 2D matrix or array - sorted row-wise and column-wise, find the kth largest element. Example Input Consider the array below and k=4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Output Output should be 22 Solution Method 1 - Use MaxHeaps We know if k=1, we should return A[n-1][n-1] i. [Read More]