Solved problem of rotating square matrix by 90 degrees.