Question

Write a function to rotate the matrix by 90 degree counter clockwise?

Login to Submit

Examples

A matrix 

1 2 3
4 5 6
7 8 9

is represented using JavaScript arrays as [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

The 90 degree counter clockwise rotated version of above matrix is

3 6 9
2 5 8
1 4 7

which is [[3, 6, 9], [2, 5, 8], [1, 4, 7]]