A collection of etudes, updated weekly, for the education and enjoyment of the savvy programmer
A string like abc
has three rotations: abc
, bca
, and cab
.
Your task is to write a program that computes all the rotations of a string. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.