hasExcessiveRepeatedCharacters method
Implementation
bool hasExcessiveRepeatedCharacters() {
// Check for more than 2 consecutive identical characters
for (int i = 0; i < length - 2; i++) {
if (this[i] == this[i + 1] && this[i + 1] == this[i + 2]) {
return true;
}
}
return false;
}