← ALL NOTES
Math

1510. Stone Game IV

A position is winning exactly when I can hand my opponent a losing one — that one sentence is the whole solve. Build dp[i] = does the player who faces i stones win, and dp[i] is true whenever some square move k*k drops the opponent onto a false state.

Loading…