Rotate Image

Medium

📝 Description

Rotate nxn matrix 90 degrees clockwise in-place

Input Format

2D matrix

Output Format

Rotated matrix

Constraints

n == matrix.length == matrix[i].length

🔍 Sample Input

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

✅ Sample Output

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

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run