Assignment2 solution for square matrix Jun 17