Write a function that takes a square matrix as input. A square matrix has the same number of rows and columns, e.g. 3 x 3, 4 x 4, 5 x 5. It should return the same matrix rotated 90 degrees clockwise. The rotation should happen in place, meaning you may not create any extra matrixes or arrays in your function.
We’ll treat the input matrix as a series of nested layers. We’ll start from the outermost layer and work our way towards the center. Here’s what that means, in terms of a 5x5 matrix. ...