Created
October 7, 2020 12:53
-
-
Save madewulf/2f48f510ba44f39fee8bc47213e7cac8 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
s = new Set(); | |
for (i = 0 ; i < 500000; i++) | |
s.add(""+i); | |
count = 0; | |
for (i = 0 ; i < 500000; i++) | |
if (s.has(""+i)) | |
count = count + 1; | |
console.log(count); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This creates a set of 500 000 strings and then checks if they are in the set.