All problems
Matrix Max Norm
Problem
Compute the entrywise max norm of matrix A: the largest absolute entry.
||A||_max = max_ij |A[i][j]|
Hint
Flatten the matrix in your mind and take the largest absolute value.
Test cases
case 1
in: [[[1,-7],[3,2]]]
expected: 7
case 2
in: [[[0,0],[0,0]]]
expected: 0
case 3
in: [[[1.5,-2.5]]]
expected: 2.5
case 4
in: [[[-4]]]
expected: 4
Starter codePython
def matrix_max_norm(A):
# Your code here
pass4 test cases · run your code against them in the editor