Rotate 2d array closewise 90 degrees
Solution 1
1. move from top layer to inner layer
2. each layer shrinks one element from both ends
Solution 2:
1. transpose the the array
2. reflect the array with the middle of vertical line
Print spiral shape from given rectangle array
1. move from top layer to inner layer
2. each layer shrinks one element from both ends