PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Matrix Rotation Challenge
#Level 1
#Rotate Matrix by 90 degrees
'''
[CHALLENGE] Matrix Rotation
The task is. You have a Matrix NxN. You should rotate it on 90 degrees.
Example:
N = 3
Input:
1 2 3
4 5 6
7 8 9
Output:
7 4 1
8 5 2
9 6 3
Levels:
1) just rotate matrix
2) matrix is 1D array (1 2 3 4 5 6 7 8 9)
3) input and output is the same memory block (the same array)
'''
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run