In this post we will solve the LeetCode 1347 Minimum Number of Steps to Make Two Strings Anagram problem using Java.
You are given two strings of the same length s and t. In one step you can choose any character of t and replace it with another character. Return the minimum number of steps to make t an anagram of s. An Anagram of a string is a string that contains the same characters with a different (or the same) ordering. Constraints: o 1 <= s.length <= 5 * 10^4 o s.length == t.length o s and t consist of lowercase English letters only. Related Topics: o Hash Table o String
It seems that in this problem it is needed to replace the minimum number of characters in string `t` with lowercase characters from the English alphabet in order to make `t` an anagram of string `s`. Continue reading “LeetCode 1347 Minimum Number of Steps to Make Two Strings Anagram in Java”