Min Max Game Solution in C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n^2)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n)\n# Code\n```\nclass Solution {\npublic:\n    int minMaxGame(vector<int>& nums) {\n        vector<int> arr;\n        int i, new_num, n;\n        n = nums.size();\n        while(n>1)\n        {\n            n = nums.size();\n            for(i=0 ; i<n/2 ; i++)\n            {\n                if(i%2==0)\n                {\n                    new_num = min(nums[2*i], nums[2*i+1]);\n                    arr.push_back(new_num);\n                }\n                else\n                {\n                    new_num = max(nums[2*i], nums[2*i+1]);\n                    arr.push_back(new_num);\n                }\n            }\n            nums.clear();\n            nums = arr;\n            arr.clear();\n        }\n        return nums[0];\n    }\n};\n```\n![upvote new.jpg](https://assets.leetcode.com/users/images/792a2ee3-fa92-4936-9a87-216cd9a9ac02_1682613207.1269994.jpeg)
['C++']