Skip to content

Instantly share code, notes, and snippets.

@linstantnoodles
Created August 15, 2012 03:40
Show Gist options
  • Save linstantnoodles/3355502 to your computer and use it in GitHub Desktop.
Save linstantnoodles/3355502 to your computer and use it in GitHub Desktop.
CTCI 1.1
var hash_table = {};
function check_dup(name){
for(i = 0; i < name.length; i++){
if(name[i] in hash_table){
return false;
}else{
hash_table[name[i]] = true;
}
}
return true;
}
alert(check_dup("al3gyu"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment