Comment Comment by muth02446 If you are satisfied with an approximation of "DISTINCT", there is a facinating probabilistic algorithm by Flajolet and Martinhttps://en.wikipedia.org/wiki/Flajolet%E2%80%93Martin_algori...which fits on 10 lines and does not require sorting. Improved versions of it are LogLog and HyperLogLog. parent muth02446 2 months ago
https://en.wikipedia.org/wiki/Flajolet%E2%80%93Martin_algori...
which fits on 10 lines and does not require sorting. Improved versions of it are LogLog and HyperLogLog.