1900. Python solution with details explanation,  beats 40% solution
class Solution:\n    \'\'\'\n     \n\t Definition of dp - It will return min and max rounds to compete first and second player\n     1. Will we give remaining p
class Solution:\n    \'\'\'\n     \n\t Definition of dp - It will return min and max rounds to compete first and second player\n     1. Will we give remaining players to dp, \n     \n     2. In dp, we will go through n/2(integer) players and collect all pairs  of player who is going to be against each other, \n        but in this pair ( f, s ) will not be there, and also who ever be against (f, s) will also not be there, since\n        the player against (f, s) will always loose. \n        \n     3. Pairs list is going to contains (a, b) player who is going to compete against each other. \n     \n     4. NOTE - (IMP ) -> product(*pairs), What is the use of this. \n        It will generate all possible remaining players, Combination of all possible remaining players\n        Example - \n        Players = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 where f = 2, s = 4\n        \n        Ex - pairs = [(1, 11), (3, 9), (4, 8), (5, 7)])\n                       |         |       |       |\n                       \n        product will give ([[1, 3, 4, 5], [1, 3, 4, 7], [1, 3, 8, 7], [1, 3, 8, 5] ... so on]) \n        Contains all possible combination of remaining players after a round\n        \n     5. remains = Will contains list of all the remaining player that are not in the pairs list. like (f , s , middle player)\n     \n     6. remains will initized by (f, s) , as these 2 will always remains in every round, as they can never loose. \n        NOTE - Apart from this, "middle" player will automatically advance to next round\n        \n        So we have to see this cond. \n        \n        if ( n % 2 == 0) ( No "middle" player) So, remains = (f, s)\n        else remains = ( f, s, "middle player") , player[n//2] is the "middle player" but Why SET is used,\n        \n        SUPPOSE =  x x x \n                   f s    n/2 = 1, but "s" is also at 1 index, so duplicate values are present, as " s " is the middle player here.\n                   To avoid this SET is used\n                   \n      7. Will we iterate through all possible "Remaing players" after a round. that we will find by doing -> product(*pairs)\n         and " nxt " is a list, of remaining players going to the "next round",\n         we will append => \n         ( All remaining Players going to the next round ) = remains + nxt\n         as (f , s, "middle player") was not in " nxt " list, so we are adding it. \n         \n      8. And call dp func to return max and min for given list of remaing players \n      \n      9. BASE CASE = When f and s are found competing, then return (1, 1) -> rounds we will add up while returning\n         mmax = max(mmax, ans[1] + 1) , here +1 will add the round\n    \'\'\'\n\tCODE - \n    def earliestAndLatest(self, n: int, f: int, s: int) -> List[int]:\n        @lru_cache(None)\n        def dp(players):\n            n = len(players)\n            \n            pairs = []\n            for i in range(n//2):\n                p1 = players[i];\n                p2 = players[n-i-1];\n                \n                if(p1 == f and p2 == s):\n                    return (1, 1)\n                \n                if p1 not in (f, s) and p2 not in (f,s):\n                    pairs.append((p1, p2))\n                    \n            remains = ()\n            if(n%2 == 0):\n                remains = (f, s)\n            else:\n                remains = tuple(set([f, s, players[n//2]]))\n                \n            mmax = -sys.maxsize\n            mmin = sys.maxsize\n            for nxt in product(*pairs):\n                nxt += remains\n                ans = dp(tuple(sorted(nxt)))\n                # since 1 round had already be done above.\n                mmin = min(ans[0]+1, mmin)\n                mmax = max(ans[1]+1, mmax)\n            return (mmin, mmax)\n        \n        return dp(tuple(range(1, n+1)))\n                    \n
[]