Given a matrix of dimensions n x n having elements 1 to n*n distinct elements, check whether the matrix is magic square or not.
Given a matrix of dimensions n x n having elements 1 to n*n distinct elements, check whether the matrix is magic square or not.