Groups
The minimum rotation of a string is the lexicographically smallest string you can get by cutting it at some position and swapping the two parts.
The prefix function π of a string tells, for every position, the length of the longest proper prefix that is also a suffix of the prefix ending there.