Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Predict the Winner

Medium Game Theory

Two players take turns picking a number from either end of an array and adding it to their score, player 1 first. Print true if player 1 can win (a tie counts as a win for player 1) assuming both play optimally.

Constraints

1 <= n <= 20 0 <= nums[i] <= 10^7

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.