contacts is list of contactlist ''return list(setcontacts )the time complexity of computing the hash is ( )where is the number of strings in the contact list hash codes are often cached for performancewith the caveat that the cache must be cleared if object fields that are referenced by the hash function are updated hash tables have the best theoretical and real-world performance for lookupinsert and delete each of these operations has ( time complexity the ( time complexity for insertion is for the average case-- single insert can take (nif the hash table has to be resized consider using hash code as signature to enhance performancee to filter out candidates consider using precomputed lookup table instead of boilerplate if-then code for mappingse from character to valueor character to character when defining your own type that will be put in hash tablebe sure you understand the relationship between logical equality and the fields the hash function must inspect specificallyanytime equality is implementedit is imperative that the correct hash function is also implementedotherwise when objects are placed in hash tableslogically equivalent objects may appear in different bucketsleading to lookups returning falseeven when the searched item is present sometimes you'll need multimapi map that contains multiple values for single keyor bi-directional map if the language' standard libraries do not provide the functionality you needlearn how to implement multimap using lists as valuesor find third party library that has multimap table top tips for hash tables know your hash table libraries there are multiple hash table-based data structures commonly used in python--setdictcollections defaultdictand collections counter the difference between set and the other three is that is set simply stores keyswhereas the others store key-value pairs all have the property that they do not allow for duplicate keysunlikefor examplelist in dictaccessing value associated with key that is not present leads to keyerror exception howevera collections defaultdict returns the default value of the type that was specified when the collection was instantiatede if collections defaultdict(list)then if not in then [kis [ collections counter is used for counting the number of occurrences of keyswith number of set-like operationsas illustrated below collections counter ( = = collections counter ( = = add two counters together [xd[ ]collections counter ({' ' ' ' } subtract keeping only positive counts )collections counter ({' ' } intersection min( [ ] [ ]collections counter ({' ' ' ' }