Search
⌘K

Leetcode 1872. Stone Game VIII

Two players alternately remove a prefix of length >1, add its sum to their score, and replace it by a single stone until one remains; compute the final optimal (Alice−Bob) score difference. The problem reduces to a minimax/dynamic-programming on suffix sums to choose optimal split points efficiently for n up to 1e5.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.