Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions hash_practice/exercises.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down