Shashank likes strings in which consecutive characters are different. For example, he likes ABABA, while he doesn’t like ABAA. Given a string containing charactersand only, he wants to change it into a string he likes. To do this, he is allowed to delete the characters in the string.
Your task is to find the minimum number of required deletions.
The first line contains an integer
The next lines contain a string each.
For each test case, print the minimum number of deletions required.
length of string
5 AAAA BBBBB ABABABAB BABABA AAABBB
3 4 0 0 4
BBBBB B, 4 deletions
ABABABAB ABABABAB, 0 deletions
BABABA BABABA, 0 deletions
AAABBB AB, 4 deletions because to convert it to AB we need to delete 2 A’s and 2 B’s