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

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

1 Expert Approved Answer
Step: 1 Unlock

Answer Here is your correct code def longestrepetitivesubstrings n lens for i in rangen 2 0 1 Start ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!