Counting exactly the number of distinct elements: sorted arrays vs. hash sets? | Hacker News Reader