Amazon | Virtual Onsite Quetsion
Anonymous User
1608

Given a n*n 2d array. Push every element in the array by 1 (or rotate the 2d matrix by 1)
example :
Input :
1 2 3
4 5 6
7 8 9
Output :
4 1 2
7 5 3
8 9 6
Overall it was like first row elements shifts to right, then last col elements move down,
last row elements move left and finally first col elements move up.
Can anyone help with a possible solution in JAVA?

Comments (6)