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
I'm not sure that I understand your attempted solution. KMP is a useful subroutine, though -- the smallest period is how far KMP moves the needle string (i.e., S) after a complete match.