Minimum Number of Steps to Make Two Strings Anagram II
You are given two strings s and t. In one step, you can append any character to either s or t.
Return the minimum number of steps to make s and t anagrams of each other.
An anagram of a string is a string that contains the same characters with a different (or the same) ordering.
Example 1
Input
s = "leetcode", t = "coats"Output
7Appending "as" to
s and "leede" to t makes the strings anagrams using 2 + 5 = 7 steps, and no fewer steps can work.Example 2
Input
s = "night", t = "thing"Output
0The given strings are already anagrams of each other, so no further steps are needed.
Constraints
- 1 <= s.length, t.length <= 2 * 10^5
- s and t consist of lowercase English letters.