← ALL NOTES
Array

877. Stone Game

The move that makes this game tractable is collapsing two players into one number: instead of tracking Alice's score and Bob's score apart, I track the lead the player to move can force on each subarray. One value per interval, and whoever's turn it is maximizes it.

Loading…