[Python] keep string instead of bitmask
\n\n    def earliestAndLatest(self, n: int, firstPlayer: int, secondPlayer: int) -> List[int]:\n        step, first, last, xs = 0, 0, 0, [firstPlayer, secondPla
\n```\n    def earliestAndLatest(self, n: int, firstPlayer: int, secondPlayer: int) -> List[int]:\n        step, first, last, xs = 0, 0, 0, [firstPlayer, secondPlayer]\n        # mark firstPlayer and secondPlayer as \'!\', others as \'.\'\n        work = {\'!\'.join([ \'.\' * (y - x - 1) for x,y in zip([0] + xs, xs + [n+1]) ])}\n        while work:\n            step += 1\n            m, n = divmod(n, 2)\n            old, work = work, set()\n            for s in old:\n                # firstPlayer and secondPlayer competes?\n                if (\'!\',\'!\') in set(zip(s[:m], s[::-1])):\n                    if not first: first = step\n                    last = step\n                    continue\n                now = {s[m] if n else \'\'}\n                for x,y in zip(s[m-1::-1], s[m+n:]):\n                    if x == \'!\': now = { x + s for s in now }\n                    elif y == \'!\': now = { s + y for s in now }\n                    else: now = { x + s for s in now } | { s + y for s in now }\n                work |= now\n            n += m\n        return [first, last]\n```
['Python']