Skip to content

Instantly share code, notes, and snippets.

@tangoabcdelta
Created December 1, 2020 02:35
Show Gist options
  • Save tangoabcdelta/68d833050ea34526c9b56e79f47bbeb2 to your computer and use it in GitHub Desktop.
Save tangoabcdelta/68d833050ea34526c9b56e79f47bbeb2 to your computer and use it in GitHub Desktop.
HackerRank NodeJS Boilterplate Code
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++];
}
// Before attempting any HackerRank question
// This boilerplate code has to be added to it
// HackerRank has managed to live so many years
// Yet, it still requires this much boilerplate
// code set up to just do what? A + B ?
// ...
// What a shame..
// what a shame..
//
// Guess those zillion dollar fundings were useful
// for what?
//
// ?
function main() {
// solution approach
var a = parseInt(readLine());
var b = parseInt(readLine());
function solveMeFirst(a, b) {
// Hint: Type return a+b below
return a+b;
}
var res = solveMeFirst(a, b);
// this output will be evaluated
console.log(res);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment