Rotate Matrix 90°

Medium · rating 1450 · Matrix, Implementation

The first line contains n. The next n lines each contain n integers. Print the matrix rotated 90° clockwise, one row per line.

Constraints: 1 ≤ n ≤ 500

Related problems

Open Rotate Matrix 90° in Code Arena →