Skip to content

Commit 663f7b4

Browse files
author
Amogh Singhal
authored
Create isMatrixSymmetric.py
1 parent 6f12319 commit 663f7b4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

isMatrixSymmetric.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def isMatrixSymmetric(mat, size):
2+
for i in range(size):
3+
for j in range(size):
4+
if mat[i][j] != mat[j][i]:
5+
break
6+
return False
7+
8+
return True
9+
10+
ipMat = [[1,2,3],[2,4,5],[3,5,8]]
11+
result = isMatrixSymmetric(ipMat, len(ipMat))
12+
print(result)

0 commit comments

Comments
 (0)