Problem
Rotate the n x n matrix 90 degrees clockwise in place.
Example 1
Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]
Output: [[7,4,1],[8,5,2],[9,6,3]]
Constraints
- 1 <= n <= 20
Notes
- Focus on the underlying matrix pattern.
- Write the cleanest correct solution before optimizing further.
- Hidden tests cover larger edge cases than the visible examples.