Created
March 6, 2018 12:44
-
-
Save Lackoftactics/984d5661a202d6c5d82a6c7d8070c451 to your computer and use it in GitHub Desktop.
rotate matrix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are given an n x n 2D matrix that represents an image. Rotate the image by 90 degrees (clockwise). | |
Example | |
For | |
a = [[1, 2, 3], | |
[4, 5, 6], | |
[7, 8, 9]] | |
the output should be | |
rotateImage(a) = | |
[[7, 4, 1], | |
[8, 5, 2], | |
[9, 6, 3]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment