Javascript Solution
The trick here is to figure out how many total moves Alice and Bob will get in this game. If Alice has more moves than Bob then Alice wins. Otherwise Bob wins.\
The trick here is to figure out how many total moves Alice and Bob will get in this game. If Alice has more moves than Bob then Alice wins. Otherwise Bob wins.\n\ne.g. \'AAAABBBBAAA\'\n\n* We have four A\'s in a row in the beginning.\n\t* This means that Alice can do two moves here.\n* Then we have four B\'s in a row.\n\t* This means that Bob can do two moves here.\n* FInally we have three A\'s in a row.\n\t* This means that Alice can do one move here.\n\nThe total we get is 4 moves for Alice and 2 moves for Bob. So Alice wins.\n\nFor each consequitive group of same letter that are 3 or more in a row, the number of moves will be that count minus 2. So if 4 in a row, then that person can do 2 moves.\n\n``` \nvar winnerOfGame = function(colors) {\n\t// COUNT HOW MANY MOVES ALICE GETS\n    let aliceMoves = 0;\n    let aCount = 0;\n    \n    for (let i = 0; i < colors.length; i ++) {\n\t\t// IF WE HAVE THE CORRECT COLOR THEN WE INCREMENT THE COUNT\n        if (colors[i] === \'A\') {\n            aCount ++;\n        }\n        \n\t\t// IF THE COLOR CHANGES TO THE WRONG COLOR OR IF WE REACHED THE END OF THE STRING THEN WE CHECK IF 3 OR MORE TO GET THE MOVE COUNT\n        if (colors[i] === \'B\' || i === colors.length  - 1) {\n            if (aCount >= 3) {\n                aliceMoves += (aCount - 2);\n            }\n            aCount = 0;\n        }\n    }\n    \n\t// COUNT HOW MANY MOVES BOB GETS\n    let bobMoves = 0;\n    let bCount = 0;\n    \n    for (let i = 0; i < colors.length; i ++) {\n        if (colors[i] === \'B\') {\n            bCount ++;\n        }\n        \n        if (colors[i] === \'A\' || i === colors.length  - 1) {\n            if (bCount >= 3) {\n                bobMoves += (bCount - 2);\n            }\n            bCount = 0;\n        }\n    }\n    \n    return aliceMoves > bobMoves;\n};\n\ntime O(n)\nspace O(1)
['JavaScript']