Java | Constant Space | O(log n)
\nclass Solution {\n    public int minMaxGame(int[] nums) {\n     \n        int n = nums.length;\n        \n        while(n>1){\n           int k = 0;\n        
```\nclass Solution {\n    public int minMaxGame(int[] nums) {\n     \n        int n = nums.length;\n        \n        while(n>1){\n           int k = 0;\n           for(int i = 0; i < n/2; i++){\n               \n               if(i % 2 == 0){\n                   nums[i] = Math.min(nums[k], nums[k+1]);\n                   k = k + 2;\n               }else{\n                   nums[i] = Math.max(nums[k], nums[k+1]);\n                   k = k + 2;\n               }\n           }\n           \n           n = n / 2; \n        }\n        \n        return nums[0];\n    }\n}\n```
[]