Interview program – Matrix

Print squares of diagonal elements in O(n) time complexity

Input: 1 2 3
4 5 6
7 8 9
Output: 1 25 81
9 25 49

Thanks and Regards,
Solution provided by Nilmani Prashanth

About the author

Bushan Sirgur

Well, I am Bushan Sirgur from Banglore, India. Currently, I am working as a Software Developer in a Service Base Company. I am interested in JAVA/J2EE, Angular 2, JavaScript, jQuery, MongoDB.

View all posts

Leave a Reply

Your email address will not be published. Required fields are marked *