Hi,
I have a question about the solution of problem 13.1 in v1.4.11. The solution uses unordered_map to map all strings with the same sorted value into the same vector of string. Thus this vector of string is a group of anagrams and multiple groups are represented by multiple vectors.
My question is: when two different sorted strings are hashed, is it possible that they have the same hash value, i.e. a collision happens? If it is possible, then two group of anagrams might be combined together. If it is not possible, it simply means that unordered_map never have any collision. I’m wondering how it achieves this. I googled for collision avoidance of unordered_map, but didn’t find any. I’m rookie to unordered_map.
Thanks,