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.
Subscribe to:
Post Comments (Atom)

1 comments:
http://en.wikipedia.org/wiki/Longest_repeated_substring_problem
Post a Comment