primeiro commit

This commit is contained in:
2025-02-12 12:33:39 +00:00
commit 0204a191c7
7 changed files with 96 additions and 0 deletions

View 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