4 ms·
It is possible to get exact count with no extra memory, but it's going to be much slower: sort the set in-place and then do equivalent of `uniq | wc -l`.
by pornel 15y ago
It is possible to get exact count with no extra memory, but it's going to be much slower: sort the set in-place and then do equivalent of `uniq | wc -l`.
- chrisaycock 15y agoYou can shorten that further with just: uniq -c