Skip to content

Commit 8ecb50d

Browse files
Update 242-Valid-Anagrams.py
1 parent 6e77153 commit 8ecb50d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

python/242-Valid-Anagrams.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,4 @@ def isAnagram(self, s: str, t: str) -> bool:
88
for i in range(len(s)):
99
countS[s[i]] = 1 + countS.get(s[i], 0)
1010
countT[t[i]] = 1 + countT.get(t[i], 0)
11-
for c in countS:
12-
if countS[c] != countT.get(c, 0):
13-
return False
14-
return True
11+
return countS == countT

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy