2273. Find Resultant Array After Removing Anagrams

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 2273

class Solution:
    def removeAnagrams(self, words: List[str]) -> List[str]:
        return [
            w
            for i, w in enumerate(words)
            if i == 0 or sorted(w) != sorted(words[i - 1])
        ]