2386. Min Max Game
My accepted Python solution to LeetCode problem 2386, Min Max Game, running in 3ms.
- Difficulty: Easy
- Python
- Runtime 3ms
- Memory 17.4MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 3ms, memory 17.4MB, accepted 2025-12-29.
class Solution:
def minMaxGame(self, nums: List[int]) -> int:
while len(nums) > 1:
newNums = []
for i in range(len(nums) // 2):
if i % 2 == 0:
newNums.append(min(nums[2*i], nums[2*i + 1]))
else:
newNums.append(max(nums[2*i], nums[2*i + 1]))
nums = newNums
return nums[0]