- Node v6+
# Clone/fork the repository
git clone --depth 1 https://github.com/itho/hackerrank.js.git
# Change directory
cd hackerrank
# Install dependencies
npm install
- On all HackerRank challenges, you can see a link on the right side bar "Download sample test cases". Clicking this will start the download of the available input & output files.
- Create a folder for the challenge like
/challenges/solve-me-first/
. Move the downloadedinput
andoutput
folders here along with your solution namedsolution.js
. Copy in the stub from HackerRank and get hacking! - Run the commands below from the root of the project.
# If your codes outputs to the console/stdout
node hackerrank.js challenges/solve-me-first --console
node hackerrank.js challenges/solve-me-first --stdout
# If your code outputs to a file
node hackerrank.js challenges/solve-me-first --file
- You can also add additional/custom testcases. Just ensure that the input and output filenames match.
itho/hackerrank is MIT licensed.