i just wrote a program, which...
within [FunFunPython]
finds: (funny, futon, python)
( 5- and 6- letter words )
(my program uses a Trie, but is pretty simple)
Maybe someone would show me
how it's done using itertools, Permutations, etc.
Wouldn't it get too slow for Letter-Seeds longer than 11 letters or so?
i just wrote a program, which...
within [FunFunPython]
finds: (funny, futon, python)
( 5- and 6- letter words )
(my program uses a Trie, but is pretty simple)
Maybe someone would show me
how it's done using itertools, Permutations, etc.
Wouldn't it get too slow for Letter-Seeds longer than 11 letters or so?
______________________
Find 6-letter words that are hidden (embedded) within each row of letters.
The letters are in the correct order.
1. JSOYOMFUBELR
2. SCDUARWDRLYE
3. DASNAGEFERTY
4. CLULOOTSCEHN
5. USENEARSEYNE
The letters are in the correct order. -------- So this problem is not about Anagraming.
Find 6-letter words that are hidden (embedded) within each row of letters. The letters are in the correct order.
1. JSOYOMFUBELR
2. SCDUARWDRLYE
3. DASNAGEFERTY
4. CLULOOTSCEHN
5. USENEARSEYNE
The letters are in the correct order. -------- So this problem is not about Anagraming.You can get every combination of 6 letters out of it with itertools.combinations like below.
Just implement the isWord function to return whether a string actually counts as a legit word or not.
12 choose 6 is only 924 combinations to check, so shouldn't be too bad to check them all.
def isWord(word):
return True #Best left as an exercise to the reader
startWord = "JSOYOMFUBELR"
subLetterCount = 6
foundWords = set()
for letters in itertools.combinations(startWord, subLetterCount):
word = "".join(letters)
if word not in foundWords and isWord(word):
print(word)
foundWords.add(word)
You can get every combination of 6 letters out of it with itertools.combinations like below.
for letters in itertools.combinations(startWord, subLetterCount):
word = "".join(letters)
if word not in foundWords and isWord(word) ...
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 79:17:57 |
Calls: | 6,716 |
Files: | 12,247 |
Messages: | 5,357,912 |