Skip to content

Commit 1b01c93

Browse files
authored
Update Valid Anagram - Leetcode 242.py
1 parent ce663c9 commit 1b01c93

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Valid Anagram - Leetcode 242.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ class Solution:
33
def isAnagram(self, s: str, t: str) -> bool:
44
if len(s) != len(t):
55
return False
6+
67
s_dict = Counter(s)
78
t_dict = Counter(t)
89

910
return s_dict == t_dict
11+
12+
# Time complexity: O(n)
13+
# Space complexity: O(n)

0 commit comments

Comments
 (0)