matrix.median_matrix ==================== .. py:module:: matrix.median_matrix .. autoapi-nested-parse:: https://en.wikipedia.org/wiki/Median Functions --------- .. autoapisummary:: matrix.median_matrix.median Module Contents --------------- .. py:function:: median(matrix: list[list[int]]) -> int Calculate the median of a sorted matrix. Args: matrix: A 2D matrix of integers. Returns: The median value of the matrix. Examples: >>> matrix = [[1, 3, 5], [2, 6, 9], [3, 6, 9]] >>> median(matrix) 5 >>> matrix = [[1, 2, 3], [4, 5, 6]] >>> median(matrix) 3