there n piece arrange line piece color a b you give string color length n colorsi color ith pieceAlice Bob playing game alternating turn remove piece line in game Alice move firstAlice allow remove piece color a neighbor color A she allow remove piece color BBob allow remove piece color b neighbor color b he allow remove piece color AAlice Bob remove piece edge lineif player turn player lose player winsAssuming Alice Bob play optimally return true Alice win return false Bob win Example 1input color AAABABBOutput trueexplanationaaababb AABABBAlice move firstshe remove second a leave a neighbor ANow Bobs turnBob turn Bs neighbor BThus Alice win return trueexample 2input color aaoutput falseexplanationalice turn firstthere as edge line turnthu Bob win return falseexample 3input color ABBBBBBBAAAOutput falseexplanationabbbbbbbaaa ABBBBBBBAAAlice move firsther option remove second a rightabbbbbbbaa ABBBBBBAANext Bobs turnHe option b piece remove he pick anyOn alice second turn piece removeThus Bob win return false Constraints1 colorslength 105colors consist letter a b