java.lang.Object
g3101_3200.s3138_minimum_length_of_anagram_concatenation.Solution

public class Solution extends java.lang.Object
3138 - Minimum Length of Anagram Concatenation.

Medium

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:

Input: s = “abba”

Output: 2

Explanation:

One possible string t could be "ba".

Example 2:

Input: s = “cdef”

Output: 4

Explanation:

One possible string t could be "cdef", notice that t can be equal to s.

Constraints:

  • 1 <= s.length <= 105
  • s consist only of lowercase English letters.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    minAnagramLength(java.lang.String s)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • minAnagramLength

      public int minAnagramLength(java.lang.String s)