Practice Min Max Game
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
nums has power-of-two length. Until only one entry remains, pair consecutive entries and build an array of half the length: output pair index i takes the pair minimum when i is even and maximum when i is odd. Repeat on that new array and return the final value.
Source: Min Max Game on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
nums = [1,3,5,2,4,8,2,2]
Output
1
# Example 2
Input
nums = [3]
Output
3
Constraints
1 <= nums.length <= 1024
1 <= nums[i] <= 10^9
nums.length is a power of 2.
Related LeetCode Problems
Practice more problems similar to Min Max Game.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.