Created
May 31, 2018 00:51
-
-
Save fielding/395406e4bb2eeeecf66803346c56d058 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function solve(data) { | |
// example returns sum of a line of integers seperated by a space | |
// return data.split(' ').reduce((acc, cur) => acc += Number(cur), 0); | |
return data; | |
} | |
process.stdin.resume(); | |
process.stdin.setEncoding('ascii'); | |
let stdin = ''; | |
process.stdin.on('data', function (data) { | |
stdin += data; | |
}); | |
process.stdin.on('end', function () { | |
const stdinArr = stdin.split('\n'); | |
const tests = stdinArr.shift(); | |
let res; | |
for (let i = 0; i < tests; i += 1) { | |
res = solve(stdinArr[i]); | |
process.stdout.write(res + '\n'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment