Tap here to switch tabs
Problem
Submissions

Problem: Minimum Number of Steps to Make Two Strings Anagram II

Minimum Number of Steps to Make Two Strings Anagram II asks you to make two given strings anagrams by appending characters to either one, then return the fewest additions required.

Statement

You are given two strings s and t. In a single step, you can append any character to either s or t.

Return the minimum number of steps required to make s and t anagrams of each other.

Note: An anagram is a string that contains the same characters with the same frequencies as another string, but the order of characters can be different.

Constraints:

  • 1≤1 \leq s.length, t.length ≤2×105\leq 2 \times 10^5

  • s and t consist of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Number of Steps to Make Two Strings Anagram II

Minimum Number of Steps to Make Two Strings Anagram II asks you to make two given strings anagrams by appending characters to either one, then return the fewest additions required.

Statement

You are given two strings s and t. In a single step, you can append any character to either s or t.

Return the minimum number of steps required to make s and t anagrams of each other.

Note: An anagram is a string that contains the same characters with the same frequencies as another string, but the order of characters can be different.

Constraints:

  • 1≤1 \leq s.length, t.length ≤2×105\leq 2 \times 10^5

  • s and t consist of lowercase English letters.