Get Mystery Box with random crypto!

Day 33 Question: Given an n x n 2D matrix rotate it by 90 degr | Competitive programming questions

Day 33 Question: Given an n x n 2D matrix rotate it by 90 degrees (clockwise) in C++ in place

You have to rotate the image in-place (https://en.wikipedia.org/wiki/In-place_algorithm), which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.
Example 1:

Given input matrix =

[
[1,2,3],
[4,5,6],
[7,8,9]
],

rotate the input matrix in-place such that it becomes:

[
[7,4,1],
[8,5,2],
[9,6,3]
]
Solution:
https://www.prodevelopertutorial.com/given-an-n-x-n-2d-matrix-rotate-it-by-90-degrees-clockwise-in-c-in-place/

Buy the book:
https://www.instamojo.com/aj_guides/ajs-guide-to-algorithm-and-data-structure-in/