Greedy  log(N) solution
This greedy code can handle n up to 1e18. No iteration over choices, no min() or max() used. \nHowever, the solution is hard to explain. Sorry, have to leave it
This greedy code can handle n up to 1e18. No iteration over choices, no min() or max() used. \nHowever, the solution is hard to explain. Sorry, have to leave it for you guys to understand.\n```py\nclass Solution(object):\n    def earliestAndLatest(self, n, a, b):\n        """\n        :type n: int\n        :type firstPlayer: int\n        :type secondPlayer: int\n        :rtype: List[int]\n        """\n        def simplify(n, a, b):\n            # swap\n            if a>b: a, b = b, a\n            # flip\n            if a+b >= n+1:\n                a, b = n+1-b, n+1-a\n            return n, a, b\n    \n        def get_info(n,a,b):\n            ll, rr = a-1, n-b\n            aa = n-ll\n            bb = 1+rr\n            return ll,rr,aa,bb\n\n        def while_loop(n, a, b):\n            ans = 1\n            while a+b < n+1:\n                n = (n+1)/2\n                ans += 1\n            if b-a-1==0:\n                while n%2:\n                    n = (n+1)/2\n                    ans += 1\n            return ans\n\n        def solve_fast(n, a, b):\n            n, a, b = simplify(n, a, b)\n            if a+b == n+1: \n                return 1\n\n            # b is on the left, including center\n            if b <= (n+1)/2:\n                return while_loop(n, a, b)\n            \n            # b is on the right\n            ll, rr, aa, bb = get_info(n, a, b)\n            if (ll%2==1 and bb-a-1==0):\n                if (n%2==0) and (b == n/2+1):                    \n                    return 1 + while_loop((n+1)/2, a, a+1)\n                else:\n                    return 3\n            else:\n                return 2\n\n        def solve_slow(n, a, b):\n            n, a, b = simplify(n, a, b)\n            if a+b==n+1: \n                return 1\n            # b is in the left, all can be deleted\n            if b <= n+1-b:  \n                return 1+solve_slow((n+1)/2, 1, 2)\n            else:\n                # b is in the right\n                ll, rr, aa, bb = get_info(n, a, b)\n                keep = (b-bb-1)/2 + n%2\n                return 1+solve_slow((n+1)/2, 1, 1+keep+1) \n\n        return [solve_fast(n,a,b), solve_slow(n,a,b)]\n```\t\t
['Greedy', 'Python']