How do I compare a list of unsorted words of variable length and remove duplicate words that have a suffix?
Example word list:
iron curl curled railroad curler curling curls irons pan pans park parker parks parked railroads
iron curl railroad pan park
The words all have different lengths, not just four or eight letters. I know how to search and print words containing suffixes but I'm not sure how to compare a list of words, some of which have suffixes, and then remove the words with suffixes, if there is a word that does not have a suffix on the list, without changing the sort order.