How to find repeated character blocks within a string?

-1

I am doing a college job and in order to continue I need to get a message that has been given and find out if there are repeated character blocks within that message and what the block is. Example: message = banana; I know it has a block of characters 'na' that is repeated twice in the message. I would know to find a repeated character, but a set of characters I have no idea.

    
asked by anonymous 06.10.2018 / 15:35

1 answer

0

I believe that with the regular expression library "re" you can solve this problem, if you want some help with the code you could pass examples of what will happen and what you expect to be the output. p>     

09.10.2018 / 21:02