|
2 | 2 |
|
3 | 3 | importjava.util.Arrays; |
4 | 4 |
|
5 | | -/** |
6 | | - * 1347. Minimum Number of Steps to Make Two Strings Anagram |
7 | | - * |
8 | | - * Given two equal-size strings s and t. In one step you can choose any character of t and replace it with another character. |
9 | | - * Return the minimum number of steps to make t an anagram of s. |
10 | | - * An Anagram of a string is a string that contains the same characters with a different (or the same) ordering. |
11 | | - * |
12 | | - * Example 1: |
13 | | - * Input: s = "bab", t = "aba" |
14 | | - * Output: 1 |
15 | | - * Explanation: Replace the first 'a' in t with b, t = "bba" which is anagram of s. |
16 | | - * |
17 | | - * Example 2: |
18 | | - * Input: s = "leetcode", t = "practice" |
19 | | - * Output: 5 |
20 | | - * Explanation: Replace 'p', 'r', 'a', 'i' and 'c' from t with proper characters to make t anagram of s. |
21 | | - * |
22 | | - * Example 3: |
23 | | - * Input: s = "anagram", t = "mangaar" |
24 | | - * Output: 0 |
25 | | - * Explanation: "anagram" and "mangaar" are anagrams. |
26 | | - * |
27 | | - * Example 4: |
28 | | - * Input: s = "xxyyzz", t = "xxyyzz" |
29 | | - * Output: 0 |
30 | | - * |
31 | | - * Example 5: |
32 | | - * Input: s = "friend", t = "family" |
33 | | - * Output: 4 |
34 | | - * |
35 | | - * Constraints: |
36 | | - * 1 <= s.length <= 50000 |
37 | | - * s.length == t.length |
38 | | - * s and t contain lower-case English letters only. |
39 | | - * */ |
40 | 5 | publicclass_1347 { |
41 | 6 | publicstaticclassSolution1 { |
42 | 7 | publicintminSteps(Strings,Stringt) { |
|