Given a dictionary of words, find out the longest chain of 'ancestors'
in it. Ancestors are defined in the following way: A word is said to
be the parent of another word if
1) It is a valid word in the dictionary
2) It can be obtained by deleting one character of the word and
permuting the remaining characters.
eg. run is a parent of urns
A possible chain of ancestors could be:
a
an
ban
nabs
bands
This chain is of length 4. What is the length of the longest chain in
a given dictionary?
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.