C++ Iterative and recursive solution
Please upvote if found this helpful\n\n```\nint solve(vector &nums,int n){\n    if(n == 1)\n            return nums[0];\n        \n        vector temp;\n       
**Please upvote if found this helpful**\n\n```\nint solve(vector<int> &nums,int n){\n    if(n == 1)\n            return nums[0];\n        \n        vector<int> temp;\n        int c = 0;\n        for(int i = 0;i<nums.size();i+=2){\n            if(c%2==0)\n                temp.push_back(min(nums[i],nums[i+1]));\n            if(c%2)\n                temp.push_back(max(nums[i],nums[i+1]));\n            c++;\n        }\n        return solve(temp,n/2);\n    }\n\tint minMaxGame(vector<int>& nums) {\n\tint ans = solve(nums,nums.size());\n        return ans;\n    }\n\t\n\t\n\t\n\t\n\t**Itertive solution**\n\t\n\t\n\t\n\t int minMaxGame(vector<int>& nums) {\n        int ans = 0;\n        int size = nums.size();\n        if(size == 1)\n            return nums[0];\n        while(size != 1){\n            vector<int> temp;\n            int c = 0;\n            for(int i = 0;i<size;i+=2){\n                if(c%2==0)\n                temp.push_back(min(nums[i],nums[i+1]));\n                if(c%2==1)\n                    temp.push_back(max(nums[i],nums[i+1]));\n                c++;\n            }\n            if(temp.size() == 1)\n                return temp[0];\n            size = size/2;\n            nums = temp;\n        }\n        return 0;\n\t\t}
['Recursion', 'C', 'Iterator', 'C++']