Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created December 30, 2015 16:42
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/faa770bc104ae38971e0 to your computer and use it in GitHub Desktop.
Save chuck0523/faa770bc104ae38971e0 to your computer and use it in GitHub Desktop.
var uniqueNums = 0;
var visited = {};
for(var i = 0; i < input.length; i += 1) {
if(visited[input[i]]) {
uniqueNums += 1;
} else {
visited[input[i]] = true;
}
}
console.log(uniqueNums);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment