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

Stone Game

Medium Game Theory

Alice and Bob take turns picking either the first or the last pile from a row of piles; the total number of stones is odd and the number of piles is even. Each player maximises their own stones and Alice moves first. Print true if Alice wins.

Constraints

2 <= n <= 500 (n even) 1 <= piles[i] <= 500

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.