Solution to Rotate Matrix