You are given a string containing characters and only. Your task is to change it into a string such that there are no matching adjacent characters. To do this, you are allowed to delete zero or more characters in the string.
Your task is to find the minimum number of required deletions.
Remove an at positions and to make in deletions.
Complete the alternatingCharacters function in the editor below.
alternatingCharacters has the following parameter(s):
string s: a string
int: the minimum number of deletions required
The first line contains an integer , the number of queries.
The next lines each contain a string to analyze.
Each string will consist only of characters and .
The characters marked red are the ones that can be deleted so that the string does not have matching adjacent characters.