Created
December 5, 2015 04:13
-
-
Save chuck0523/029e3c48036a45a9f10f to your computer and use it in GitHub Desktop.
This file contains 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
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