##
Sum of both diagonals of a spiral odd-order square matrix
January 15, 2017

We have given a spiral matrix of odd-order, in which we start with the number 1 as center and moving to the right in a clockwise direction. Examples: Input : n = 3 Output : 25 Explanation : spiral matrix = 7 8 9 6 1 2 5 4 3 The sum of diagonals is… Read More »