- 2

Help me to solve this..!

matrix of any size rotation challenge (in any language) https://www.sololearn.com/post/32861

22nd Sep 2018, 4:09 AM
Onkar Bhogale
Onkar Bhogale - avatar
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.
24th Sep 2018, 9:34 PM
John Wells
John Wells - avatar
22nd Sep 2018, 7:18 AM
Mert Yazıcı
Mert Yazıcı - avatar
+ 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
22nd Sep 2018, 1:57 PM
John Wells
John Wells - avatar
+ 2
you mean... help you solve it?
22nd Sep 2018, 12:22 PM
Flandre Scarlet
Flandre Scarlet - avatar
+ 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
23rd Sep 2018, 12:35 PM
John Wells
John Wells - avatar
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
23rd Sep 2018, 5:23 AM
Onkar Bhogale
Onkar Bhogale - avatar