A tool that should make it easier to write and test Go solutions for HackerRank challenges.
The hacktherank tool allows you to run a set of test data samples against your source code.
Usage
Install the tool
go install github.com/mokiat/hacktherank@latest
Create a test data file
This is a file which contains the input lines to test with and the expected output lines. It is possible to specify multiple test scenarios (or samples) within a single file. Following is an example for a sum challenge.
input:
3 5
output:
8
input:
10 20
output:
30
Note: Make sure that all relevant new-line symbols are added and that no unexpected blank space characters are inserted. The tool matches lines exactly - without trimming.
Write your solution
You should create a main.go file somwhere and add your Go implementation to it.
Test your solution with the hacktherank tool
Following is a demonstration using the example folder of this project.