Question: Write a program if some substring K that can be repeated N > 1 times to produce the input string exactly as it appears.

Write a program if some substring K that can be repeated N > 1 times to produce the input string exactly as it appears. Your program should return longest substring K, and if there is none it should be return "There is no repetitive substring" For Example is str ="abcababcababcab" str="abcdefabcdef" str ="abcdefabcdefabcdefabcdef" str ="abcdefxabcdef" output should be abcab output should be abcdef output should be abcdefabcdef output should be "There is no epetitive substring"
Step by Step Solution
3.36 Rating (174 Votes )
There are 3 Steps involved in it
Answer Here is your correct code def longestrepetitivesubstrings n lens for i in rangen 2 0 1 Start ... View full answer
Get step-by-step solutions from verified subject matter experts
