All problems
Determinant of Product
Problem
Compute the determinant of the product A*B of two 2x2 matrices using the identity
det(A*B) = det(A) * det(B)
Hint
No need to multiply the matrices; multiply their determinants.
Test cases
case 1
in: [[[1,2],[3,4]],[[5,6],[7,8]]]
expected: 4
case 2
in: [[[2,0],[0,3]],[[1,1],[0,1]]]
expected: 6
case 3
in: [[[1,2],[2,4]],[[3,1],[1,3]]]
expected: 0
case 4
in: [[[1,0],[0,1]],[[4,7],[2,6]]]
expected: 10
Starter codePython
def det_product(A, B):
# Your code here
pass4 test cases · run your code against them in the editor