← 返回 doordash 的题目列表Minimum Replacements to Make Two Strings Anagrams
类型:online_judge
doordash
Given two strings s and t, find the minimum number of character replacements needed to make the two strings anagrams (i.e., rearrange to have the same set of characters). The strings consist of only lowercase letters. Implement the algorithm and explain the time and space complexity. Provide test cases.
Example:
Input: s = "anagram", t = "mangaar" Output: 0
Input: s = "xaxb", t = "bxxc" Output: 1
Input: s = "leetcode", t = "practice" Output: 5
Example
Input
s = 'anagram'
t = 'mangaar'