You're probably right, but the code example is incorrect - it's not checking for collisions. It's only checking if the hash is in the set. With a good hash function, you can be confident that there won't be any collisions, but that's not how sets work - collisions can still occur inside the set.
2025-07-28 17:22:05
1
Aiden :
In Python, the hash of an integer is the integer itself. Of course there are no collisions 🤦♂️
2025-08-10 04:53:53
0
exg0rd :
return len(nums) != len(h)
no?
2025-07-26 15:11:47
2
To see more videos from user @greghogg5, please go to the Tikwm
homepage.