Skip to content

Instantly share code, notes, and snippets.

@KKrisu
Created August 13, 2013 07:44
Show Gist options
  • Save KKrisu/6218758 to your computer and use it in GitHub Desktop.
Save KKrisu/6218758 to your computer and use it in GitHub Desktop.
function getHash (v) {
return v.x+'-'+v.y+'-'+v.z;
}
function solve(input) {
var l = input.length,
map = {};
while(l--) {
map[getHash(input[l])] = l;
}
l = input.length;
while(l--) {
if( map[ getHash(input[l]) ] > -1 && map[ getHash(input[l]) ] !== l ) {
return true;
};
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment