AUTHOR=Yang Zongbao , He  Zhimin , Li  Lvzhou , Dong  Shoubin , Zheng  Shenggeng TITLE=A linear algorithm for the restricted subtraction games JOURNAL=Frontiers in Physics VOLUME=Volume 10 - 2022 YEAR=2022 URL=https://www.frontiersin.org/journals/physics/articles/10.3389/fphy.2022.1049019 DOI=10.3389/fphy.2022.1049019 ISSN=2296-424X ABSTRACT=Subtraction game is a well-known problem in the field of game theory, which is often called as a one-heap Nim game. There are two players, a heap of tokens and a strategy matrix in this game. It is called a restricted subtraction game, if some constrains are imposed on the strategy matrix. The subtraction game could be solved by a classical algorithms with query complexity no less than O(N^2) and computed by an O(N^\frac{3}{2} log N) quantum query algorithm with error probability $\epsilon \leq \frac{1}{N}$. The restricted subtraction game proposed by Huang et, al. can be computed by an exact quantum algorithm with $O(N^\frac{3}{2})$ queries. They also proved that the classical exact query complexity is \Theta(N^2). In this paper, we use an array and an adjacency list to replace the strategy matrix, and propose another more general subtraction game comparing to the one introduced by Huang et, al. Based on the dynamic programming and the replaced game strategy, two linear classical query algorithms are designed to solve the restricted subtraction game proposed by Huang and this paper, respectively.