Consider an M array, write a unique (M) function that returns True if the array has all distinct elements and False otherwise:
[[1,2], [3,4]] -> True
[[2,2], [3,4]] -> False
my code is:

def unique(M):
r=len(M)
c=len(M[0])
check = True

for i in range(r):
for j in range(c):
if M[i][j]!=M[j][i]:
return False
...