Skip to content
Veltoryx Technologies
ProProblem 12● MediumLeetCode #48 ↗2 min readUpdated 30 October 2026

Rotate Image

Rotate a square matrix 90° clockwise in place by transposing it and then reversing each row.

01The problem

Rotate an n × n matrix 90° clockwise, in place (don't create another matrix).

text
1 2 3        7 4 1
4 5 6   →    8 5 2
7 8 9        9 6 3

Loading the rest of the lesson…