Problem LinkAuthor: Bhuvnesh Jain Tester: Bhuvnesh Jain Editorialist: Bhuvnesh Jain DifficultyCAKEWALK PrerequisitesSorting, Looping Techniques ProblemThe median of a matrix is defined as the median of the median of all rows. Find the median of the matrix. ExplanationTo find the median, we need the numbers to be sorted in increasing order. To sort the numbers, we can use merge sort or inbuilt sort algorithm available in the languages. Once, we find the median of all rows, we can do the same trick to find the median of all rows. To read more about sorting algorithms, refer to this link Time Complexity$O(N * N * \log{N})$, per test case. Space Complexity$O(N * N)$ Solution Linksasked 20 Nov '17, 22:01
