Solution to the string rotation problem.