Given the following problem :
Definition : Let S be a string over alphabet Σ .S\' is the smallest period of S
Definition :
Let S be a string over alphabet Σ .S\' is the smallest period of S
S\'
S
this problem can be solved using the Z function , this tutorial can help you .