My issue
really i am not getting
My code
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int N;
cin >> N;
string s;
cin >> s;
int alice = 0, bob = 0;
char server = 'A'; // Initially, Alice is the server
for (int i = 0; i < N; i++) {
if (s[i] == server) {
alice++;
} else {
// When the receiver wins, change the server for the next round
server = (server == 'A') ? 'B' : 'A';
}
}
cout << alice << " " << bob << endl;
}
return 0;
}
Learning course: Strings using C++
Problem Link: Blobby Volley Scores Practice Problem in - CodeChef