Remove Two, Five, or Six — Solution & Editorial
Grundy DP: g[n] = mex of reachable values; non-zero = first player wins.
Complexity: O(max n · moves)
Grundy DP: g[n] = mex of reachable values; non-zero = first player wins.
Complexity: O(max n · moves)