- 2
Help me to solve this..!
matrix of any size rotation challenge (in any language) https://www.sololearn.com/post/32861
6 ответов
+ 1
Onkar Bhogale Since you haven't confirmed, I posting my code for that:
https://code.sololearn.com/cG4cI74c5Rnx
Your feed post only shows a shift of one, which this can do by removing for loop.
+ 5
Post your challenges here:
https://www.sololearn.com/Discuss/1270852/?ref=app
+ 3
If you are looking for a hint to solve, try this:
Rotate the matrix to the left. This is done by rotating the 4 similar positions so in the example below the corners (1, 3, 7, & 9) and the edges (2, 4, 6, & 8). On bigger matrices, there are more boxes and edges of the box so a 9 by 9 matrix has 20 unique positions to move.
1 2 3 7 4 1
4 5 6 8 5 2
7 8 9 9 6 3
+ 2
you mean... help you solve it?
+ 1
That is a weird rotate. One for outer box. Two for inner. Would a nine do 1, 2, 3, and 4?
10 1 2 3 4 5 6 7 8
19 29 20 11 12 13 14 15 9
28 38 48 39 30 21 22 16 18
37 47 57 51 50 49 23 17 27
46 56 58 42 41 40 24 26 36
55 65 59 33 32 31 25 35 45
64 66 60 61 52 43 34 44 54
73 67 68 69 70 71 62 53 63
74 75 76 77 78 79 80 81 72
0
look...
If user enters 5
it will generate 5*5 matrix
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
n it's rot_matrix =
6 1 2 3 4
11 17 12 7 5
16 18 13 8 10
21 19 14 9 15
22 23 24 25 20