diff --git a/hash_practice/exercises.py b/hash_practice/exercises.py index 48bf95e..6768fdf 100644 --- a/hash_practice/exercises.py +++ b/hash_practice/exercises.py @@ -6,6 +6,19 @@ def grouped_anagrams(strings): Space Complexity: ? """ pass +# empty hashtable (dict) +empty = {} +# key is the tuple of letters and the value = are all the words that have some combo of those letters in the tuple +# loop the list of strings (each word) +for word in strings: + new_tuple = [] +# loop through each word in the list of strings + for letter in word: + new_tuple.append(letter) +# the order you put things in list, is the order they're appear in a tuple +#how are you gonna tell if the tuple of eat or tea? +#use built in methods, to sort it out- to ensure tuples appear in same order before you put in dict +pass def top_k_frequent_elements(nums, k): """ This method will return the k most common elements