Created
December 30, 2015 16:02
-
-
Save chuck0523/9b15f1b88ba817838fc7 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 visited = []; | |
var isUnique = function(n) { | |
return visited.indexOf(n) === -1; | |
}; | |
for(var i = 1; i <= num; i += 1) { | |
if(isUnique(input[i])) { | |
uniqueNums += 1; | |
} else { | |
visited.push(input[i]); | |
} | |
} | |
console.log(uniqueNums); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment