A basket is given to you in the shape of a matrix. If the size of the matrix is N x N then the range of number of eggs you can put in each slot of the basket is 1 to N2 . You task is to arrange the eggs in the basket such that the sum of each row, column and the diagonal of the matrix remain same. Test case for your reference: Input by the user dimension of the basket i.e., N = 3 So, number of eggs you can put at each slot are in the range of 1 to 32 (1 to 9) Input: 6 3 6 5 5 5 4 7 4
I am expecting a python code to check if a matrix forms a magic square or not.