Company: Walmart_1sept
Difficulty: medium
Diagonal Sum of Spiral Matrix Problem Description Anisha is starting a new business setting up safe deposit lockers across the city. For a fee, customers can temporarily store their luggage or any other articles. They can lock and unlock the locker using an app. When storing articles, the customer locks the locker by providing an odd number of their choice, N , as the lock. When recovering the articles, the customer needs to use the key provided by the app. The app uses N to generate the key, and provides it to the customer only after receiving payment for the locker use. Anisha has designed a web service that generates the unlock key K by using N . The web service first generates a matrix of size NxN . The matrix is filled with numbers starting from 1 to N 2 , with 1 always at the center of the matrix. The rest of the numbers ( 2 to N 2 ) are filled in sequence around the center, in a clockwise direction. A property of this filling method is that only odd numbers are at the corners of