I have a list of items that was improperly created. Instead of copying the whole item once, it made multiple partial copies of the same item. The partial duplicates are mixed with other duplicates and some unique items. For example list a:
a = ['one two','one two three four','one two three','five six','five six seven','eight nine']
I want to remove the partial duplicates and keep the longest expression of the item. For example I would like to produce list b:
b = ['one two three four', 'five six seven','eight nine']
The integrity of the item must remain intact, cannot become:
c = '[two one three four', 'vife six seven', 'eight nine']