primeiro commit
This commit is contained in:
13
242-valid_anagram/python/242.py
Normal file
13
242-valid_anagram/python/242.py
Normal file
@ -0,0 +1,13 @@
|
||||
# 242. Valid Anagram
|
||||
#
|
||||
# https://leetcode.com/problems/valid-anagram/
|
||||
#
|
||||
# Given two strings s and t, return true if t is an anagram of s, and false otherwise.
|
||||
|
||||
def isAnagram(s: str, t: str) -> bool:
|
||||
if len(s) != len(t):
|
||||
return False
|
||||
for i in range(len(s)):
|
||||
if s.count(s[i]) != t.count(s[i]):
|
||||
return False
|
||||
return True
|
||||
Reference in New Issue
Block a user