There is an old, popular riddle:
Find an english word with 8 letters that, taken away one letter, creates a new valid word. Repeat that until there is no letters left.
Example solution:
starting
staring
string
sting
sing
sin
in
I
Write a script that, given a file with words*, outputs one word that counts as an answer to the riddle. The output can be in any form, but it has to be the only output.
* You can assume the words file to have one word per line and to be alpha-sorted. For testing you can use the /usr/share/dict/words
or /usr/dict/words
file if you are on Linux/Unix/Mac.
Allowed languages: Python, Ruby, Perl, Bash (in any version).
No external libraries except if they usually come pre-installed.
Sidequest:
Find the longest possible word that can be disassembled this way.
May the smartest solution win.