2 C++ solutions || Beginner-friendly approach || With and without recursion
\n# Code\n\n// Solution 1 (with recursion)\nclass Solution {\npublic:\n    int minMaxGame(vector<int>& nums) {\n       int n=nums.size();\n       if(n==1) retur
\n# Code\n```\n// Solution 1 (with recursion)\nclass Solution {\npublic:\n    int minMaxGame(vector<int>& nums) {\n       int n=nums.size();\n       if(n==1) return nums[0];\n       vector<int> newNum(n/2);\n       for(int i=0; i<n/2; i++) { \n            if(i%2==0) \n                newNum[i] = min(nums[2 * i], nums[2 * i + 1]); \n            else \n                newNum[i] = max(nums[2 * i], nums[2 * i + 1]); \n        } \n        int res = minMaxGame(newNum);\n        return res;\n    }\n};\n\n// Solution 2 (without recursion)\nclass Solution {\npublic:\n    int minMaxGame(vector<int>& nums) {\n        int n=nums.size();\n        while(n>1){\n            int k=0;\n            for(int i=0;i<n/2;i++){\n                if(k%2==0) \n                    nums[k]=min(nums[2*i],nums[2*i+1]);\n                else \n                    nums[k]=max(nums[2*i],nums[2*i+1]);\n                k++;\n            }\n            n/=2;\n        }\n        return nums[0];\n    }\n};\n```
['C++']