Minimum Anagram Deletions
Imagine you have two sets of letters and want to leave only the letters that can form the same word in a different order. Write a function make_anagram_deletions that returns the minimum number of character deletions needed to make strings a and b anagrams of each other. In one operation, you may delete one character from either string.
Примеры
Ввод
"cde", "abc"Вывод
4Ввод
"abc", "abc"Вывод
0Ввод
"aaa", "a"Вывод
2Нужно реализовать
def make_anagram_deletions(a: str, b: str) -> int:
Теги
stringshashmapdict
Συνδεθείτε για να δείτε το ιστορικό υποβολών
ΣύνδεσηΣυνδεθείτε για να χρησιμοποιήσετε τον AI Mentor
ΣύνδεσηTests12
Visible tests
Κρυφό τεστ 7
Κρυφό τεστ 8
Κρυφό τεστ 9
Κρυφό τεστ 10
Κρυφό τεστ 11
Κρυφό τεστ 12
They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.
Focus radio
Paused · SomaFM · Fluid