Objective
Rotating a matrix 90° clockwise is equivalent to reversing the order of the rows and transposing. After rotating, a matrix of f rows and c columns has c rows and f columns.
Instructions
- The first line has the number of rows
fand columnsc; then comeflines with the values separated by spaces. - Show the matrix rotated 90° clockwise.
2 3
1 2 3
4 5 6
4 1
5 2
6 3
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise