cpp
class Solution {\npublic:\n    int minMaxGame(vector& nums) {\n        int n=log2(nums.size());\n        vectorv=nums;\n        while(n>0){\n            int fla
class Solution {\npublic:\n    int minMaxGame(vector<int>& nums) {\n        int n=log2(nums.size());\n        vector<int>v=nums;\n        while(n>0){\n            int flag=0;\n            vector<int>x;\n            for(int i=0;i<v.size();i=i+2){\n            if(flag==0){\n                x.push_back(min(v[i],v[i+1]));\n                flag=1;\n            }\n            else if(flag==1){\n              x.push_back(max(v[i],v[i+1]));\n                flag=0;\n            }\n            }\n            v=x;\n            n--;\n        }\n        return v[0];\n    }\n};
[]