18.7k views
2 votes
the count repeated characters method looks for character sequences of the form xyy, that is, a character followed by the same character and preceded by a different one. that is the start of a group. note that there are two conditions. the condition

User Grizzly
by
8.1k points

1 Answer

3 votes

Okay, breaking down the count repeated characters method:

The goal is to find sequences of the form:

xyy

Where:

x is a character

y is the same character that follows x

The two conditions are:

1) y is the same character that follows x

2) x is a different character from y

So some examples of sequences that would match are:

aba

cad

eef

But these would not match:

abb

ccd

fff

Since in those cases, both x and y are the same character.

The key is that there needs to be a transition from one character to two of the same character, to identify a repeated character sequence.

Hope this clarifies the count repeated characters method! Let me know if you have any other questions.

User Tarun Parswani
by
8.5k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.

9.4m questions

12.2m answers

Categories