✅C++ | Use recursion | Explanation through comments
\nclass Solution {\npublic:\n    //Use recursion\n    int minMaxGame(vector<int>& nums) \n    {\n        //base condition \n        if(nums.size()==1)\n        
```\nclass Solution {\npublic:\n    //Use recursion\n    int minMaxGame(vector<int>& nums) \n    {\n        //base condition \n        if(nums.size()==1)\n            return nums[0];\n        \n        //define new vector newnums which stores min and max values and then again pass to the function\n        vector<int> newnums;\n        int n = nums.size(), ans;\n        \n        //iterate till n/2 times\n        for(int i=0; i<n/2; i++)\n        {\n            //if index is even \n            if(i%2==0)\n                newnums.push_back(min(nums[2*i], nums[2*i+1]));\n            \n            //if index is odd\n            else\n                newnums.push_back(max(nums[2*i], nums[2*i+1]));\n        \n        }\n        \n        //pass newnums to the minMaxGame function for next level recursion\n        ans = minMaxGame(newnums);\n        return ans;        \n    }\n};\n```
['Recursion', 'C', 'C++']