1

Symmetric Matrix

Unsolved
Linear Algebra

Difficulty: 2 | Problem written by mesakarghm
Problem reported in interviews at

Amazon
Apple
Facebook
Google
Netflix

A square matrix is said to be symmetric matrix if the transpose of the matrix is the same as the given matrix. 

The transpose of a matrix can be obtained by changing the rows to columns and columns to rows. 

For a given n by n matrix (implemented as a multi dimensional list), check if it is symmetric or not. 

Return True if the matrix is symmetric, return False otherwise. 

 

Sample Input:
<class 'list'>
mat: [[1, 3, 5], [3, 2, 4], [5, 4, 1]]

Expected Output:
<class 'bool'>
True

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Nisi porro eaque libero eius culpa quisquam cupiditate nesciunt adipisci, natus laudantium suscipit, fuga tempore repudiandae impedit dignissimos consequuntur maiores tempora quae architecto, quas maiores voluptates animi consequatur sunt?

Odit cupiditate nisi, sequi consectetur inventore blanditiis eveniet laboriosam eius optio praesentium.

Nesciunt odit possimus exercitationem eos labore magni fuga, sapiente molestiae obcaecati ipsa? Odio quos voluptatum veniam porro aliquid qui dolorem est cupiditate, tempora sed neque rerum eos id ratione at libero amet, possimus quae unde amet aliquam alias voluptatem optio?

This is a premium feature.
To access this and other such features, click on upgrade below.

Ready.

Input Test Case

Please enter only one test case at a time
numpy has been already imported as np (import numpy as np)