My LeetCode grinding. Trying to do a problem a day.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

problem.txt 944B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Given two equal-size strings s and t. In one step you can choose any character of t and replace it with another character.
  2. Return the minimum number of steps to make t an anagram of s.
  3. An Anagram of a string is a string that contains the same characters with a different (or the same) ordering.
  4. Example 1:
  5. Input: s = "bab", t = "aba"
  6. Output: 1
  7. Explanation: Replace the first 'a' in t with b, t = "bba" which is anagram of s.
  8. Example 2:
  9. Input: s = "leetcode", t = "practice"
  10. Output: 5
  11. Explanation: Replace 'p', 'r', 'a', 'i' and 'c' from t with proper characters to make t anagram of s.
  12. Example 3:
  13. Input: s = "anagram", t = "mangaar"
  14. Output: 0
  15. Explanation: "anagram" and "mangaar" are anagrams.
  16. Example 4:
  17. Input: s = "xxyyzz", t = "xxyyzz"
  18. Output: 0
  19. Example 5:
  20. Input: s = "friend", t = "family"
  21. Output: 4
  22. Constraints:
  23. 1 <= s.length <= 50000
  24. s.length == t.length
  25. s and t contain lower-case English letters only.