A perfect hash function for a set S is a hash function that maps distinct elements in S to a set of integers, with no collisions.