Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Determinant by UFO665
def checkio(data):
if len(data) == 1:
return data[0][0]
elif len(data) == 2:
return data[0][0] * data[1][1] - data[0][1] * data[1][0]
else:
return sum((-1) ** (2 - (i % 2 == 1)) * data[0][i] * checkio([[elem for j, elem in enumerate(r) if j != i] for r in data[1:]]) for i in range(len(data)))
Feb. 12, 2016