I am looking for a way to check if an element of a list is sub-element of any other elements of that same list?
For example, let's use the below list as an example.
['Lebron James', 'Lebron', 'James']
The 2nd and 3rd elements of this list are a sub-element of the 1st element of the list.
I am looking for a way to remove these elements from the list so only the 1st element remains. I have been spinning my wheels and unable to come up with a solution.
Can someone help?
Thanks