Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var
lines = [],
readline = require('readline').createInterface(process.stdin, process.stdout);
readline.on('line', function(line) {
lines.push(line);
if(lines.length === 2) {
var chars = lines[0], charIndex = lines[1];
for(var i = 0; i < chars.length; i++) {
for(var j = 0; j < chars.length; j++) {
var loopIndex = i * 5 + j + 1;
if(loopIndex == charIndex ) {
console.log(chars[i] + chars[j]);
}
}
}
process.exit(0);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment