-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I use itertools::Itertools which have a nice all_unique (internally, it creates a hashset and insert elements one by one unless it already contains it) but if I really wanted efficiency, I would manage my own hashset because this method is called for each character.
for my solution, I used a bitset as an auxillary data structure. The trick is that since chracters are all lower case there's only 26 of them. This means if you use a u32 where each bit is a chracter, you can just OR the slice together and count the number of bits after ORing. https://github.com/Isawan/advent-of-code/blob/master/2022/src/bin/day6-fast.rs