Back to the Problem
Per letter, the excess |countA − countB| must go — sum over the alphabet.
Complexity: O(|A| + |B|)