S1 = S2 S2 S2......n times.

on Monday, December 14, 2009


A string is given. Write a code which will determine whether the given string is repetition of any string or not. If yes, find out the repeated string and how many times it has been repeated.
eg. string given = abcabcabcabc
ans : repeated string is abc and it is repeated 4 times.

1 comments:

Anonymous said...

http://en.wikipedia.org/wiki/Longest_repeated_substring_problem

Post a Comment