Sunday, July 16, 2017

Rotate matrix

July 16, 2017

把一个m*n的矩阵旋转90度,给一个flag规定是向左转还是向右转。


Plan to study code written in Java. The link is here

input 
1 2 3
4 5 6
7 8 9

output1
3 6 9
2 5 8
1 4 7

output2
7 4 1
8 5 2
9 6 3


No comments:

Post a Comment