> "SUBBOOKKEEPER is the only word with four pairs of double letters
> in a row.
Let's check in the wordlist available from the URL I posted earlier (with a
little help from Mathematica):
In[1]:= words = ReadList["words.txt", String];
In[2]:= Length[words]
Out[2]= 354984
In[3]:= data = Map[Characters, words];
In[4]:= Cases[data, {___, a_, a_, b_, b_, c_, c_, d_, d_, ___}]//Timing
Out[4]= {10.725 Second, {{"s", "u", "b", "b", "o", "o", "k", "k", "e", "e",
"p", "e", "r"}}}
So out of 345,984 words in this dictionary, "subbookkeeper" is the only one
that matches the criteria of four pairs of letters in a row. How about the
"pt" question:
In[5]:= Cases[data, {___, "p", "t", ___}];
In[6]:= Length[%]
Out[6]= 4263
So there are 4263 words in the list containing "pt".
G.
|