2293. Min Max Game
On This Page
class Solution:
def minMaxGame(self, nums: List[int]) -> int:
n = len(nums)
while n > 1:
n >>= 1
for i in range(n):
a, b = nums[i << 1], nums[i << 1 | 1]
nums[i] = min(a, b) if i % 2 == 0 else max(a, b)
return nums[0]