I am new to python and I want to write a program that determines if a string consists of repetitive characters. The list of strings that I want to test are:
- Str1 = "AAAA"
- Str2 = "AGAGAG"
- Str3 = "AAA"
The pseudo-code that I come up with:
WHEN len(str) % 2 with zero remainder:
- Divide the string into two sub-strings.
- Then, compare the two sub-strings and check if they have the same characters, or not.
- if the two sub-strings are not the same, divide the string into three sub-strings and compare them to check if repetition occurs.
I am not sure if this is applicable way to solve the problem, Any ideas how to approach this problem?
Thank you!