Swift | One-Liner | Also: Two Easy Solutions, Tail Recursion & No Recursion
One-Liner, terse (accepted answer)\n\nclass Solution {\n    func minMaxGame(_ nums: [Int]) -> Int {\n        nums.count == 1 ? nums[0] : minMaxGame((0 ..< nums.
**One-Liner, terse (accepted answer)**\n```\nclass Solution {\n    func minMaxGame(_ nums: [Int]) -> Int {\n        nums.count == 1 ? nums[0] : minMaxGame((0 ..< nums.count/2).reduce(into: [Int]()) { let (a,b) = (nums[$1*2], nums[$1*2+1]); $0.append($1%2 == 0 ? min(a,b) : max(a,b)) })\n    }\n}\n```\n**NOTE:** Technically qualifies as one-liner since `return` was omitted.\n\n---\n\n**One-Liner, pretty-printed and annotated (accepted answer)**\n```\nclass Solution {\n    func minMaxGame(_ nums: [Int]) -> Int {\n        nums.count == 1 ? nums[0] : minMaxGame( // tail-recursion with following array:\n            (0 ..< nums.count/2).reduce(into: [Int]()) { result, iDiv2 in\n                let (a,b) = (nums[iDiv2*2], nums[iDiv2*2 + 1])\n                result.append(iDiv2%2 == 0 ? min(a,b) : max(a,b)) // iDiv2%2 will fully cycle every four elements of incoming array\n            }\n        )\n    }\n}\n```\n\n---\n\n**Easy Solution using Tail Recursion (accepted answer)**\n\n```\nclass Solution {\n    func minMaxGame(_ nums: [Int]) -> Int {\n        guard nums.count > 1 else { return nums[0] }\n        var i = 0\n        var isMin = true\n        var result = [Int]()\n        while i < nums.count {\n            result.append(isMin ? min(nums[i], nums[i+1]) : max(nums[i], nums[i+1]))\n            isMin.toggle()\n            i += 2\n        }\n        return minMaxGame(result)\n    }\n}\n```\n\n**Easy-Solution, No Recursion, Re-use `nums` (accepted answer)**\n```\nclass Solution {\n    func minMaxGame(_ nums: [Int]) -> Int {\n        var nums = nums\n        var size = nums.count/2\n        \n        while size > 0 {\n            for i in 0 ..< size {\n                nums[i] = i%2 == 0 ? min(nums[i*2], nums[i*2+1]) : max(nums[i*2], nums[i*2+1])\n            }\n            size /= 2\n        }\n\n        return nums[0]\n    }\n}\n```
[]