1

Do you know how to find the fractional period of a string in linear time? Some examples of what I am asking for: input "cbcbcb" output 2

input "qwertyd" output 7

input "fghfghf" output 3

I have tried to solve this problem but I can't obtain a 0(n) complexity, (n is the length of the string)

Ole V.V.
  • 81,772
  • 15
  • 137
  • 161
  • Also [one](https://stackoverflow.com/questions/21169045/how-to-find-the-period-of-a-string) [two](https://stackoverflow.com/questions/8347812/given-string-s-find-the-shortest-string-t-such-that-tm-s) [three](https://stackoverflow.com/questions/48442047/detect-periodical-string) and dozens more. – n. m. could be an AI May 03 '23 at 08:24
  • What is *the fractional period of a string*? (*Fractional period* seems to have other meanings in other contexts, so a search didn’t readily find the answer.) – Ole V.V. May 05 '23 at 09:05

0 Answers0