manideepbollu / bowling-pin-challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Javascript solution for Bowling Pins challenge

Based on Sprague Grundy Game Theory explained in Theory of Impartial Games

Requirements: Node.js server must be installed on your local computer.

Manual run:

  • 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

Manual input - Example:

1 # Number of test cases
4 # Number of pins
IXXI # Pin configuration I - live pin, sX - dead pin
ctrl+D

Test file run:

  • 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

About


Languages

Language:JavaScript 100.0%