| Starting position |
Length of first half |
First half |
Second half |
| 0 |
1 |
"a" |
"b" |
| 0 |
2 |
"ab" |
"cd" |
| 0 |
3 |
"abc" |
"def" |
| 0 |
4 |
"abcd" |
Not big enough: Next starting position |
| 1 |
1 |
"b" |
"c" |
| 1 |
2 |
"bc" |
"de" |
| 1 |
3 |
"bcd" |
"efg" |
| 1 |
4 |
"bcde" |
Not big enough: Next starting position |
| 2 |
1 |
"c" |
"d" |
| 2 |
2 |
"cd" |
"ef" |
| 2 |
3 |
"cde" |
Not big enough: Next starting position |
| 3 |
1 |
"d" |
"e" |
| 3 |
2 |
"de" |
"fg" |
| 3 |
3 |
"def" |
Not big enough: Next starting position |
| 4 |
1 |
"e" |
"f" |
| 4 |
2 |
"ef" |
Not big enough: Next starting position |
| 5 |
1 |
"f" |
"g" |
| 5 |
2 |
"fg" |
Not big enough: Next starting position |
| 6 |
1 |
"g" |
Not big enough: Next starting position |
| 7 = End of string - return "square-free" |
|
|
|