Python | Top Down DP | Easier to Understand
```\n#based on https://leetcode.com/problems/the-earliest-and-latest-rounds-where-players-compete/discuss/1268560/Python-simple-top-down-dp-solution-O(N4)\nclas
```\n#based on https://leetcode.com/problems/the-earliest-and-latest-rounds-where-players-compete/discuss/1268560/Python-simple-top-down-dp-solution-O(N4)\nclass Solution:\n    def earliestAndLatest(self, n: int, firstPlayer: int, secondPlayer: int) -> List[int]:\n        @cache\n        def dfs(l, r, m):\n            if l > r: return dfs(r, l, m)\n            if l == r: return (1, 1)\n            nxt_m = (m+1)//2\n            res = [float(\'inf\'), 0]\n            #i: number of wins at left\n            for i in range(1, l + 1):\n                if r <= (m+1)//2:\n                    for j in range(l-i+1, r-i+1):\n                        low, high = dfs(i, j, nxt_m)\n                        res = min(res[0], low), max(res[1], high)\n                else:\n                    for j in range(l-i+(2*r-m+1)//2,l-i+(2*r-m+1)//2+m-l-r+1):\n                        low, high = dfs(i, j, nxt_m)\n                        res = min(res[0], low), max(res[1], high)\n            return (res[0] + 1, res[1] + 1)\n        return dfs(firstPlayer, n - secondPlayer + 1, n)
['Depth-First Search', 'Python']