I have a coding problem that will use HackerRank, which I am not familiar with. I started trying to get to know him before starting, and imagine my surprise when I saw the template code in this editor.
process.stdin.resume();
process.stdin.setEncoding('ascii');
var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;
process.stdin.on('data', function (data) {
input_stdin += data;
});
process.stdin.on('end', function () {
input_stdin_array = input_stdin.split("\n");
main();
});
function readLine() {
return input_stdin_array[input_currentline++];
}
The rest of the problems in HR have slightly modified versions of this, and I cannot help but wonder what really happens. It seems that there is some text file that the editor reads, and therefore can compare with my output?
I am very grateful for the understanding of this, since I am sure that I will have to write my own Node "template" when I make my coding call.
Thank!