From ac282f5069bf89db914d006fbbc3e2e107307514 Mon Sep 17 00:00:00 2001 From: Sandra Caballero Date: Tue, 26 Jul 2022 08:34:46 -0700 Subject: [PATCH] issing sudoku --- hash_practice/exercises.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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