Class Solution
java.lang.Object
g1301_1400.s1347_minimum_number_of_steps_to_make_two_strings_anagram.Solution
1347 - Minimum Number of Steps to Make Two Strings Anagram.<p>Medium</p>
<p>You are given two strings of the same length <code>s</code> and <code>t</code>. In one step you can choose <strong>any character</strong> of <code>t</code> and replace it with <strong>another character</strong>.</p>
<p>Return <em>the minimum number of steps</em> to make <code>t</code> an anagram of <code>s</code>.</p>
<p>An <strong>Anagram</strong> of a string is a string that contains the same characters with a different (or the same) ordering.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> s = “bab”, t = “aba”</p>
<p><strong>Output:</strong> 1</p>
<p><strong>Explanation:</strong> Replace the first ‘a’ in t with b, t = “bba” which is anagram of s.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> s = “leetcode”, t = “practice”</p>
<p><strong>Output:</strong> 5</p>
<p><strong>Explanation:</strong> Replace ‘p’, ‘r’, ‘a’, ‘i’ and ‘c’ from t with proper characters to make t anagram of s.</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> s = “anagram”, t = “mangaar”</p>
<p><strong>Output:</strong> 0</p>
<p><strong>Explanation:</strong> “anagram” and “mangaar” are anagrams.</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= s.length <= 5 * 10<sup>4</sup></code></li>
<li><code>s.length == t.length</code></li>
<li><code>s</code> and <code>t</code> consist of lowercase English letters only.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
minSteps
-