Is Symmetric
A square table is symmetric if it looks the same after swapping its rows and columns, which means m[i][j] == m[j][i] for every i and j. Return True if m is symmetric, otherwise False.
Example 1
m [[1,2],[2,3]]
returns true
m[0][1] and m[1][0] are both 2.
Example 2
m [[1,2],[5,3]]
returns false
2 and 5 differ.
Constraints
1 <= len(m) <= 8
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Largest GapEasy
- Latest PeakEasy
- Merge and SortEasy
- Missing NumbersEasy
- Most Common ValueEasy
- Most Different PositionEasy
- Outlier CountEasy
- Pair DifferencesEasy