DEV Community

Discussion on: Tackling Algorithms: Counting Unique Values

Collapse
 
adtm profile image
Tomas Eglinskas

I think also you could use this technique I wrote in this post: dev.to/adtm/whats-your-favorite-al... :)

negating numbers on the fly and checking if they exist, if it doesn't - add +1 to the counter.