/Rotate-A-Matrix

Rotate-A-Matrix

Primary LanguageJavaCreative Commons Zero v1.0 UniversalCC0-1.0

Rotate-A-Matrix

##Sample Implementation of ratating a matrix.

Problem statement:

  1. rotate a matrix clockwise
  2. only rotate one step, not 90 degree

Example 1

Input

1, 2, 3

4, 5, 6

7, 8, 9

Output

4, 1, 2

7, 5, 3

8, 9, 6

Example 2

Input

1, 2, 3, 4

5, 6, 7, 8

9, 10, 11, 12

13, 14, 15, 16

Output

5, 1, 2, 3

9, 10, 6, 4

13, 11, 7, 8

14, 15, 16, 12