-1
I am doing a college job and in order to continue I need to take a message that has been given and find out if there are repeated blocks of characters inside that message and which is the block. Example: message= banana; I know you have a block of characters 'na' that repeats twice in the message. I would know to find a repeated character, but a character set I have no idea.
What have you tried?
– vinibrsl
So far I thought I’d take a slice of the string and compare it to the whole string. For example, I take an initial slice of three characters and compare to see if I find something that matches, if yes, I compare again but with a larger slice (of 4 characters), until the comparison returns nothing else. But this I thought considering that some block of characters at the beginning of the message will repeat.
– Stéphanie Morterá