Based on Sprague Grundy Game Theory explained in Theory of Impartial Games
Requirements: Node.js server must be installed on your local computer.
- clone the repository on your local workspace
- go to the app's root directory
- run the following command on bash or cmd
node solution.js
1 # Number of test cases
4 # Number of pins
IXXI # Pin configuration I - live pin, sX - dead pin
ctrl+D
- clone the repository on your local workspace
- go to the app's root directorys
- run the following command on bash or cmd
node solution.js <path to the text file>
eg: node solution.js testcases/input/input00.txt
Challenge courtesy: HackerRank