Hi there, after looking at the solution…man, now it’s *so* obvious.

**Lesson to Myself - ALWAYS THINK BEFORE TYPING**

But besides all that, and I know this probably isn’t that important, where did my really embarrassing implementation for this problem go wrong? I get WA on Kattis

```
#include <bits/stdc++.h>
using namespace std;
// takes a bool that when true indicates that the cumulative scores of Alice and Barbara reached 10
// Now we require a new condition to win
char who_wins(int a_score, int b_score, bool activate)
{
if (activate) {
if (a_score > b_score+1) {
return 'A';
}
if (b_score > a_score+1) {
return 'B';
}
}
else {
if (a_score == 11) return 'A';
if (b_score == 11) return 'B';
}
}
int main()
{
string inp;
cin >> inp;
int alice[201];
int barbara[201];
int game_length = 0;
// goes through the string input, assigning each array the score of alice and barbara for that game_length
// if Alice gets 2 points then a[game_length] = 2 (that is what the static_cast does) and b[game_length] = 0 and vice versa
for (int i = 0; i < inp.size()-1; i += 2) {
if (inp[i] == 'A') {
alice[game_length] = static_cast<int>(inp[i+1]-'0');
barbara[game_length] = 0;
++game_length;
}
else {
barbara[game_length] = static_cast<int>(inp[i+1]-'0');
alice[game_length] = 0;
++game_length;
}
}
int cum_a, cum_b;
cum_a = cum_b = 0;
bool act = false;
char res;
// runs the score for each discrete amount of game_length through the who_wins function to get the winner
for (int i = 0; i < game_length; ++i) {
cum_a += alice[i];
cum_b += barbara[i];
if (cum_a == 10 && cum_b == 10) act = true;
res = who_wins(cum_a, cum_b, act);
}
cout << res;
return 0;
}
```