Skip to content

Instantly share code, notes, and snippets.

@bolgovr
Created June 18, 2012 20:54
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 bolgovr/2950651 to your computer and use it in GitHub Desktop.
Save bolgovr/2950651 to your computer and use it in GitHub Desktop.
var fs = require('fs');
fs.readFile('./source.txt', function (err, content) {
var array = content.toString().split('\n');
var container = {};
array.forEach(function (num) {
container[num] = 1;
});
var lookingFor = process.argv.pop();
console.log('looking for ' + lookingFor);
for (var i in container) {
if (container[lookingFor - i] === 1) {
console.log('yes');
process.exit(0);
}
}
console.log('no');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment