In some contest, there is some string related problem. Many authors use hashing algorithm to make the solution faster. When string length is so small that hash value does not overflow, then I have no question. But when string length is too big to hash value is over flow, then how solution gives guarantee that there is no hash value of two different string is unique.
Can anyone clarify it please?
Thanks.
There is no guarantee that hash values are unique, but the probability of a collision is very low.
You rather beat tourist than hashing gives a collision.
There is no guarantee that the hash of 2 different strings are unique. When using hash value to compare strings, there are always some (small) probability that your code will give incorrect answer for an input. It is up to the programmer to decide whether it is safe enough or not to use hash.
Edit: sorry for same answers as above. When I started typing, there was no comment :(