Finished first iteration of solver; working on optimizations.
Successfully implemented depth-first search to generate all possible anagrams of the scrambled input. Used a pre-computed HashSet of valid prefixes to quickly prune any branches that wouldn’t lead to valid English words.
Implemented CLI interface using Clap. Added –verbose flag for logging and –include-partial for words that do not use all available letters.
Initial optimizations include removing words that could never be made using the available letters- that is, words that are too long or contain invalid letters.
Further optimizations include using concurrency when reading the file and using smart pointers to avoid excessive cloning. Also considering the possibility of iterating over candidate WORDS and determining whether they are a valid solutions instead of using combinatorics.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.