c++ | easy | short
\n\n# Code\n\nclass Solution {\npublic:\n    int mn = 10000;\n    int mx = 0;\n    int first;\n    int second;\n    void dfs(vector<int> &arr, int round) {\n   
\n\n# Code\n```\nclass Solution {\npublic:\n    int mn = 10000;\n    int mx = 0;\n    int first;\n    int second;\n    void dfs(vector<int> &arr, int round) {\n        int size = arr.size() / 2;\n        if(arr.size() == 1) return;\n        for(int i = 0; i < size; i++) {\n            if(arr[i] == first && arr[arr.size() - i - 1] == second) {\n                mn = min(mn, round);\n                mx = max(mx, round);\n                return;\n            }\n        }\n        bool f1 = false, f2 = false;\n        for(auto n : arr) {\n            f1 |= n == first;\n            f2 |= n == second;\n        }\n        if(!f1 || !f2) { \n            return;\n        }\n        vector<int> nextarr(size + (arr.size() % 2));\n        int m = (1 << size) - 1;\n        for(int i = 0; i <= m; i++) { \n            int left = 0, right = nextarr.size() - 1;\n            for(int j = 0; j < size; j++) {\n                if((1 << j) & i) { \n                    nextarr[left++] = arr[j];\n                }else { \n                    nextarr[right--] = arr[arr.size() - j - 1];\n                }\n                \n            }\n            if(arr.size() % 2) { \n                nextarr[left] = arr[arr.size() / 2];\n            }\n            dfs(nextarr, round + 1);\n        }\n    }\n    vector<int> earliestAndLatest(int n, int firstPlayer, int secondPlayer) {\n        vector<int> arr(n);\n        for(int i= 1; i <= n; i++) {\n            arr[i - 1] = i;\n        }\n        first = firstPlayer;\n        second = secondPlayer;\n        dfs(arr, 1);\n        return {mn, mx};\n    }\n};\n```
['C++']