Sponsored
Use these hints if you're stuck. Try solving on your own first.
For every word in the input list, we can check whether all prefixes of that word are in the input list by using a Set.
Solve with full IDE support and test cases