Simplified and added notes around performance.
Rotate a matrix 90 degrees.