2186. Minimum Number of Steps to Make Two Strings Anagram II

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 2186

class Solution:
    def minSteps(self, s: str, t: str) -> int:
        cnt = Counter(s)
        for c in t:
            cnt[c] -= 1
        return sum(abs(v) for v in cnt.values())