Search
⌘K

Leetcode 1510. Stone Game IV

Two players alternately remove any positive perfect-square number of stones from a pile of n, and the player who cannot move loses; determine whether Alice (first player) has a forced win under optimal play. The core challenge is to evaluate winning/losing states up to n (n ≤ 10^5), typically by dynamic programming/minimax to see if any square move leads to an opponent losing state.


Question Timeline

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

Comments

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