Word stays a word after taking away a letter
This is a repost of this challenge
Challenge
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 are no letters left.
Example solution:
starting
staring
string
sting
sing
sin
in
I
Your task is to write a program, which takes a dictionary and outputs the longest word, that still occurs in the dictionary after repeatedly taking away a letter.
Rules
- All words will be lower case and contain only ASCII-letters
- If multiple valid words have the same length you can output any one of those
- The dictionary will never be empty
- If there isn't any solution in the dictionary, then you have to output nothing/return an empty list
- Default Loopholes apply
- This is code-golf, so the shortest answer wins!
ExamplePosted here
In: [this, hat, hi, is, i, a, at]
Out: this
In: [pings, aid, pin, ad, i, in]
Out: aid
In: ['as', 'i', 'his', 'that', 'ping', 'pin', 'in', 'was', 'at', 'this', 'what', 'is', 'it', 'and', 'a', 'in', 'can', 'if', 'an', 'hand', 'land', 'act', 'ask', 'any', 'part', 'man', 'mean', 'many', 'has', 'stand', 'farm', 'eat', 'main', 'wind', 'boat', 'ran', 'heat', 'east', 'warm', 'fact', 'fast', 'rain', 'art', 'heart', 'am', 'arm', 'sit', 'train', 'sat', 'gas', 'least', 'fit', 'flat', 'cat', 'bit', 'coast', 'sand', 'beat', 'hit', 'party', 'wing', 'wash', 'bat', 'meat', 'suit', 'fat', 'meant', 'coat', 'band', 'win', 'seat', 'hat', 'salt']
Possible outputs:
1. stand (stand -> sand -> and -> an -> a)
2. heart (heart -> heat -> eat -> at -> a)
3. train (train -> rain -> ran -> an -> a)
4. least (least -> east -> eat -> at -> a)
5. coast (coast -> coat -> cat -> at -> a)
6. party (party -> part -> art -> at -> a)
7. meant (meant -> meat -> eat -> at -> a)