All problems
2x2 Matrix Determinant
Problem
Compute the determinant of a 2x2 matrix: det = A[0][0]*A[1][1] - A[0][1]*A[1][0].
Test cases
case 1
in: [[[1,2],[3,4]]]
expected: -2
case 2
in: [[[2,0],[0,3]]]
expected: 6
case 3
in: [[[1,0],[0,1]]]
expected: 1
case 4
in: [[[0,1],[0,0]]]
expected: 0
Starter codePython
def det_2x2(A):
# Your code here
pass4 test cases · run your code against them in the editor