Skip to content

This is python code to solve the fivethirtyeight.com riddler from Sept 16, 2022

License

Notifications You must be signed in to change notification settings

jonmooser/fivethirtyeight-riddler-2022-09-16

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This code and accompanying dictionary solve the fivethirtyeight.com riddler problem having to do with "anagram chains": https://fivethirtyeight.com/features/can-you-build-the-biggest-anigram/

The process is fairly straightforward:

  • Each word in the dictionary is translated into a hash string that is independent of letter order. Each hash the represents a unique collection of letters. If two words are an anagram of each other, they will have the same hash.
  • The hashes are stored in a hash-map mapping hash strings to the set of words that have that set of letters.
  • Then, starting with each 4-letter-word, we do a depth first search over the set of hashes.
  • For performance, we memoize hashes that have already been visited to avoid redendant computation.

About

This is python code to solve the fivethirtyeight.com riddler from Sept 16, 2022

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages