Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Clear oneliner (using NumPy module) solution in 3rd party category for Skew-symmetric Matrix by quarkov
import numpy
'''
Test system threw 'numpy.bool is a wrong data type' for this solution,
but it works correctly too:
def checkio(indata):
return numpy.all(numpy.array(indata) == -(numpy.array(indata)).T)
I changed an approach a little so the solution below had passed tests.
'''
def checkio(indata):
matrix = numpy.array(indata)
matrix += matrix.T
for i in range(len(matrix)**2):
if matrix.item(i) != 0:
return False
return True
June 7, 2018
Comments: