Help me in solving STC13 problem

My issue

That's my code. It's working in some cases but in some, isn't.
If the input is "AA", it's not giving any output but according to my dry run, it should. I could not figure it out, why. Help me to find the problem.

My code

//here is my code

#include <bits/stdc++.h>
using namespace std;

int main() 
{
	int t;
    cin >> t;
	
	while(t--)
	{
	    string S;
	    cin >> S;
	    int playCount = 0, validDayCount = 0, flag = 0;
	    playCount = S.length();
	    if(playCount%2 == 0){
	        for(int i=0; i<playCount; i+=2)
	        {
	            if(S[i] == S[i+1]) //checking if A & B played once in a day or not, if not then the flag will be incremented
	            {
	                flag++; 
	                break;
	            }
	            else validDayCount++; // if they played once in a day everyday, then count that day as a validday
	        }
	       
	        if(flag > 0) //if the flag is incremented, that means they didn't play once in day everyday
	        {
	            
	            cout<<"no"<<endl; 
	            break;
	        }
	        if(validDayCount == playCount/2) cout<<"yes"<<endl; //if validDayCount is qual to the half of playCount(total days), that means they both played once per day everyday
	        else cout<<"no"<<endl; 
	    }
	    else cout << "no" << endl;
	 
	}
}
        

Learning course: Solve Programming problems using C++
Problem Link: CodeChef: Practical coding for everyone