hey, I need to rotate a 2d array in such way : 4X4-->
Input Output
1 2 3 4 5 1 2 3
5 6 7 8 1 2 6 4
1 2 3 4 5 3 7 8
5 6 7 8 6 7 8 4
or for odd 5X5-->
Input Output
1 2 3 4 5 6 1 2 3 4
6 7 8 9 10 1 2 7 8 5
1 2 3 4 5 6 7 3 9 10
6 7 8 9 10 1 8 9 4 5
1 2 3 4 5 2 3 4 5 10
can someone help me? as you can see there are two different rings and are gettin rotated .
plz help
Im out of ideas and luck.