0 out of 464 challenges solved
Write a function `max_of_nth(matrix, n)` that takes a matrix represented as a list of lists and an integer `n`, and returns the maximum value in the `n`th column of the matrix. Assume that the matrix is well-formed (all rows have the same number of columns) and that `n` is a valid column index. #### Example Usage ```python [main.nopy] matrix = [ [5, 6, 7], [1, 3, 5], [8, 9, 19] ] print(max_of_nth(matrix, 2)) # Output: 19 matrix = [ [6, 7, 8], [2, 4, 6], [9, 10, 20] ] print(max_of_nth(matrix, 1)) # Output: 10 ```
def max_of_nth(matrix, n): """ Returns the maximum value in the nth column of the given matrix. Args: matrix (list of list of int): The input matrix. n (int): The column index to find the maximum value for. Returns: int: The maximum value in the nth column. """ # Placeholder for the solution pass