DP for Tower of coins nim game