3138. Minimum Length of Anagram Concatenation
3138. Minimum Length of Anagram Concatenation
Description
You are given a string s
, which is known to be a concatenation of anagrams of some string t
.
Return the minimum possible length of the string t
.
An anagram is formed by rearranging the letters of a string. For example, “aab”, “aba”, and, “baa” are anagrams of “aab”.
Example 1:
1 | Input: s = "abba" |
Example 2:
1 | Input: s = "cdef" |
Constraints:
1 <= s.length <= 10^5
s
consist only of lowercase English letters.
Hints/Notes
- iterate the factors
Solution
Language: C++
1 | class Solution { |