PROJECT EULER · #0477
Number Sequence Game
The number sequence game starts with a sequence
Two players alternate turns. The players on their respective turns must select and remove either the first or the last number remaining in the sequence.
A player's own score is (determined by) the sum of all the numbers that player has taken. Each player attempts to maximize their own sum.
If- Player 1: removes the first number (
) - Player 2: removes the last number from the remaining sequence (
) - Player 1: removes the last number from the remaining sequence (
) - Player 2: removes the remaining number (
)
Player 1 score is
Let
modulo
The sequence begins with
You are given
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.