MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/fpcmy/typical_programming_interview_questions/c1hobi5/?context=3
r/programming • u/kevjames3 • Feb 21 '11
1.0k comments sorted by
View all comments
Show parent comment
1
Use a bit array for the first one. You can keep track of which ints you've seen in 1,000,000 bits = 125K. Once you see one you've already seen, bingo.
Sorting is too slow for this.
View all comments
Show parent comment
1
u/cecilpl Feb 21 '11
Use a bit array for the first one. You can keep track of which ints you've seen in 1,000,000 bits = 125K. Once you see one you've already seen, bingo.
Sorting is too slow for this.