Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Instead of removing each repeating anagram, try to find all the strings in words which will not be present in the final answer.
For every index i, find the largest index j < i such that words[j] will be present in the final answer.
Check if words[i] and words[j] are anagrams. If they are, then it can be confirmed that words[i] will not be present in the final answer.