C++ | Two Solutions | Easily Understandable
\nTime: O(Log n * n)  Space: O(1)\n\nclass Solution {\npublic:\n    int minMaxGame(vector<int>& nums) {\n        int n=size(nums);\n        if(n==1)\n          
```\nTime: O(Log n * n)  Space: O(1)\n\nclass Solution {\npublic:\n    int minMaxGame(vector<int>& nums) {\n        int n=size(nums);\n        if(n==1)\n                return nums[0];\n        bool flag=true;\n        for(int i=0,j=0;i<n;i=i+2,j++){\n            if(flag){\n                nums[j]=min(nums[i],nums[i+1]);\n            }else{\n                nums[j]=max(nums[i],nums[i+1]);\n            }\n            //cout<<n<<" "<<flag<<" "<<nums[j]<<"::";\n            flag=!flag;\n            if(i+2==n){\n                i=-2,j=-1;\n                n= n>>1;\n            }\n            if(n==1)\n                return nums[0];\n        }\n        return nums[0];\n    }\n};\n\nTime: O(2*n-1)  Space: O(n)  ---> 1+2+4+..+n=2*n-1\n\nclass Solution {\npublic:\n    int minMaxGame(vector<int>& nums) {\n        int n=size(nums);\n        if(n==1)\n                return nums[0];\n       vector<int> num(n/2);\n        for(int i=0;i<n/2;i++){\n            if(i&1)\n                num[i]=max(nums[2*i],nums[2*i+1]);\n            else\n                num[i]=min(nums[2*i],nums[2*i+1]);\n        }\n        return minMaxGame(num);\n    }\n};\n```
['C']