Count Together A's and B's || Easy
```\n  bool winnerOfGame(string colors) {\n        \n        int cntA = 1 , cntB = 1;\n        int totA = 0 , totB = 0;\n        string s = colors ;\n        \n
```\n  bool winnerOfGame(string colors) {\n        \n        int cntA = 1 , cntB = 1;\n        int totA = 0 , totB = 0;\n        string s = colors ;\n        \n        for(int i=1 ; i<colors.size() ; i++ )\n        {\n            if(s[i] == s[i-1])\n            {\n                if(s[i] == \'A\') cntA++;\n                else cntB++;\n            }\n            \n            // ABBBBBBBAAA\n            \n            else{\n                totA+= max(0 , cntA-2 ) ;\n                totB+= max(0 , cntB-2 ) ;\n                cntA = 1 , cntB = 1;\n\n            }\n        }\n        \n                totA+= max(0 , cntA-2 ) ;\n                totB+= max(0 , cntB-2 ) ;\n                cntA = 1 , cntB = 1;\n        \n        if(totA > totB) return 1;\n        return 0;\n}
[]