simple and easy C++ solution 😍❤️‍🔥
if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n\n# Code\n\nclass Solution {\npublic:\n    int minMaxGame(vector<int>& nums) \n    {\n        if(nums.size
# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n\n# Code\n```\nclass Solution {\npublic:\n    int minMaxGame(vector<int>& nums) \n    {\n        if(nums.size()==1) return nums[0];\n        int n;\n        bool flag = true;\n        while(nums.size() > 2)\n        {\n            n = nums.size();\n            // vector<int>temp = nums;\n            nums.clear();\n            for(int i=0;i<n;i+=2)\n            {\n                if(flag) nums.push_back(min(nums[i], nums[i+1]));\n                else nums.push_back(max(nums[i], nums[i+1]));\n                flag = !flag;\n            }\n        }\n        return min(nums[0], nums[1]);\n    }\n};\n```
['Array', 'Math', 'Simulation', 'C++']