mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
39 lines
1.4 KiB
HTML
39 lines
1.4 KiB
HTML
<p>You are given a string <code>s</code>, which is known to be a concatenation of <strong>anagrams</strong> of some string <code>t</code>.</p>
|
|
|
|
<p>Return the <strong>minimum</strong> possible length of the string <code>t</code>.</p>
|
|
|
|
<p>An <strong>anagram</strong> is formed by rearranging the letters of a string. For example, "aab", "aba", and, "baa" are anagrams of "aab".</p>
|
|
|
|
<p> </p>
|
|
<p><strong class="example">Example 1:</strong></p>
|
|
|
|
<div class="example-block">
|
|
<p><strong>Input:</strong> <span class="example-io">s = "abba"</span></p>
|
|
|
|
<p><strong>Output:</strong> <span class="example-io">2</span></p>
|
|
|
|
<p><strong>Explanation:</strong></p>
|
|
|
|
<p>One possible string <code>t</code> could be <code>"ba"</code>.</p>
|
|
</div>
|
|
|
|
<p><strong class="example">Example 2:</strong></p>
|
|
|
|
<div class="example-block">
|
|
<p><strong>Input:</strong> <span class="example-io">s = "cdef"</span></p>
|
|
|
|
<p><strong>Output:</strong> <span class="example-io">4</span></p>
|
|
|
|
<p><strong>Explanation:</strong></p>
|
|
|
|
<p>One possible string <code>t</code> could be <code>"cdef"</code>, notice that <code>t</code> can be equal to <code>s</code>.</p>
|
|
</div>
|
|
|
|
<p> </p>
|
|
<p><strong>Constraints:</strong></p>
|
|
|
|
<ul>
|
|
<li><code>1 <= s.length <= 10<sup>5</sup></code></li>
|
|
<li><code>s</code> consist only of lowercase English letters.</li>
|
|
</ul>
|