Skip to content

Commit 5cb35b0

Browse files
committed
Time: 34 ms (5.52%), Space: 18 MB (7.44%) - LeetHub
1 parent 2f93ffb commit 5cb35b0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution:
2+
def removeAnagrams(self, words: List[str]) -> List[str]:
3+
ans, cur = [], ""
4+
for word in words:
5+
if Counter(cur) == Counter(word):
6+
continue
7+
cur = word
8+
ans.append(cur)
9+
return ans

0 commit comments

Comments
 (0)