Solution for Rotating matrix by 90 degrees