Skip to content

Instantly share code, notes, and snippets.

@alarsyo
Created December 23, 2016 22:08
Show Gist options
  • Save alarsyo/623c7771a0b72a7a5e9a156e75587a4e to your computer and use it in GitHub Desktop.
Save alarsyo/623c7771a0b72a7a5e9a156e75587a4e to your computer and use it in GitHub Desktop.
Matrix rotation
def rotateMatrix(matrix):
newMatrix = []
l = len(matrix)
for i in range(l):
newMatrix.append([])
for j in range(l):
newMatrix[i].append(matrix[l - 1 - j][i])
return newMatrix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment