#Insert into HashMap if not duplicate value [solved c:]
4 messages · Page 1 of 1 (latest)
Best way would probably to keep the values in a hashset. If there's multiple of some values, then a hashmap of values to count. If you need to find the key for each value, then a hashmap from values to keys, aka bidirectional map.
If this is the only thing you're doing, then just swap the keys and values.
i think im going to use https://docs.rs/bimap/latest/bimap/index.html :)
A fast two-way bijective map.
thanku