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
PostgreSQLv16

Le résultat de l'exécution du code s'affichera ici

Visible tests
1
Input
"anagram", "nagaram"
ExpectedTrue
2
Input
"rat", "car"
ExpectedFalse
3
Input
"a", "a"
ExpectedTrue
4
Input
"ab", "a"
ExpectedFalse
5
Input
"aabb", "bbaa"
ExpectedTrue
6
Input
" ", "nagaram"
ExpectedFalse
Focus radio
Paused · SomaFM · Fluid