Same Letters Check
An anagram is made by rearranging the same characters without adding or losing any letters. Given two strings s and t, return True if they contain the same characters with the same counts. If any character count is different, return False.
Примеры
Ввод
"anagram", "nagaram"Вывод
TrueВвод
"rat", "car"Вывод
FalseВвод
"a", "a"Вывод
TrueНужно реализовать
def is_anagram(s, t):
Теги
stringshashmapsorting
Connectez-vous pour voir l'historique des soumissions
Se connecterConnectez-vous pour utiliser le Mentor IA
Se connecterVisible tests
1
Input
"anagram", "nagaram"Expected
True2
Input
"rat", "car"Expected
False3
Input
"a", "a"Expected
True4
Input
"ab", "a"Expected
False5
Input
"aabb", "bbaa"Expected
True6
Input
" ", "nagaram"Expected
FalseFocus radio
Paused · SomaFM · Fluid