Fewest Replacements Making One String an Anagram. The lowercase strings s and t have equal length. One operation replaces any character of t with another character.
### Problem
The lowercase strings s and t have equal length. One operation replaces any character of t with another character. Return the minimum operations making t have exactly the same character multiset as s; order need not match.
```cpp
class Solution {
public:
int minSteps(string s, string t);
};
```
### Examples
**Example 1:**
```text
Input: s = "aabc", t = "dddd"
Output: 4
Explanation: All four d characters must become the two a letters,b,and c.
```
**Example 2:**
```text
Input: s = "abca", t = "cbaa"
Output: 0
Explanation: Their letter counts already agree.
```
### Constraints
- Both strings share a length between 1 and 50000.
- Only lowercase English letters occur.
### Contract considerations
Anagram means equal multisets, not necessarily equal position-by-position strings.
```hint Read the boundary condition
Account for repeated letters and strings that are already anagrams. Only the second string may be changed.
```
### Boundary reminders
Anagram means equal multisets, not necessarily equal position-by-position strings.
Overview: Fewest Replacements Making One String an Anagram. The lowercase strings s and t have equal length. One operation replaces any character of t with another character.
The lowercase strings s and t have equal length. One operation replaces any character of t with another character. Return the minimum operations making t have exactly the same character multiset as s; order need not match.
class Solution {
public:
int minSteps(string s, string t);
};
Examples
Example 1:
Input: s = "aabc", t = "dddd"
Output: 4
Explanation: All four d characters must become the two a letters,b,and c.
Example 2:
Input: s = "abca", t = "cbaa"
Output: 0
Explanation: Their letter counts already agree.
Constraints
Both strings share a length between 1 and 50000.
Only lowercase English letters occur.
Contract considerations
Anagram means equal multisets, not necessarily equal position-by-position strings.
Boundary reminders
Anagram means equal multisets, not necessarily equal position-by-position strings.