def hash_word(s, size): hash_idx = 0 for j in range(len(s)): letter = ord(s[j]) - 96 hash_idx = (hash_idx * 26 + letter) % size return hash_idx