Simple Java iterative solution | O(1) SPACE
Since we don\'t need the previous value after finding (max/min) result, we can store the result in the same place and manage our indexes through simple calculat
Since we don\'t need the previous value after finding (max/min) result, we can store the result in the same place and manage our indexes through simple calculations as showing below.\n```\nclass Solution {\n    public int minMaxGame(int[] nums) {\n        var isMin = true;\n        var n=1;\n        \n        while(n<nums.length) {\n            \n            for(int i=0; i<nums.length; i+= n*2) {\n                nums[i] = isMin ?\n                    Math.min(nums[i], nums[i+n]) : \n                    Math.max(nums[i], nums[i+n]);\n                isMin = !isMin;\n            }\n            \n            n *= 2;\n        }\n        \n        return nums[0];\n        \n    }\n}\n```
['Java']