Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created December 5, 2015 04:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuck0523/029e3c48036a45a9f10f to your computer and use it in GitHub Desktop.
Save chuck0523/029e3c48036a45a9f10f to your computer and use it in GitHub Desktop.
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