give n x n matrix row column sort ascending order return kth small element matrixnote kth small element sorted order kth distinct elementyou find solution memory complexity well on2 example 1input matrix 159101113121315 k 8Output 13Explanation the element matrix 159101112131315 8th small number 13example 2input matrix 5 k 1output 5 Constraintsn matrixlength matrixilength1 n 300109 matrixij 109all row column matrix guarantee sort nondecrease order1 k n2 Follow upcould solve problem constant memory ie O1 memory complexitycould solve problem on time complexity the solution advanced interview find read paper fun