Problems > Deletions to Anagrams > Editorial

Deletions to Anagrams — Solution & Editorial

Back to the Problem

Per letter, the excess |countA − countB| must go — sum over the alphabet.

Complexity: O(|A| + |B|)