Open
Description
Hey lucas! If you're going to use a list of frequent bigrams/trigrams anyways, you don't need to do the first part where you generate all sane permutations of the input string, right?
That is, if you have a list common_ngrams_dict
, you could just do
for trigram in common_ngrams_dict:
if sorted(trigram) == sorted(input_string):
filtered_solution.append(trigram)
Which would avoid the O(n!) stuff in the first part. I still enjoyed the writeup, and I see how the first part still makes sense cause you'd still want to generate all sane permutations if you use the NLP approach and the anagram isn't a frequent n-gram. 👍
Metadata
Metadata
Assignees
Labels
No labels