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

Updated: 2024-03-12
1 min read
[]

On This Page

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())