1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/检查是否所有字符出现次数相同 [check-if-all-characters-have-equal-number-of-occurrences].html
2022-03-29 12:43:11 +08:00

30 lines
1001 B
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个字符串 <code>s</code> ,如果 <code>s</code> 是一个 <strong></strong> 字符串,请你返回 <code>true</code> ,否则请返回 <code>false</code> 。</p>
<p>如果 <code>s</code> 中出现过的 <strong>所有</strong> 字符的出现次数 <strong>相同</strong> ,那么我们称字符串 <code>s</code> 是 <strong></strong> 字符串。</p>
<p> </p>
<p><strong>示例 1</strong></p>
<pre><b>输入:</b>s = "abacbc"
<b>输出:</b>true
<b>解释:</b>s 中出现过的字符为 'a''b' 和 'c' 。s 中所有字符均出现 2 次。
</pre>
<p><strong>示例 2</strong></p>
<pre><b>输入:</b>s = "aaabb"
<b>输出:</b>false
<b>解释:</b>s 中出现过的字符为 'a' 和 'b' 。
'a' 出现了 3 次,'b' 出现了 2 次,两者出现次数不同。
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= s.length &lt;= 1000</code></li>
<li><code>s</code> 只包含小写英文字母。</li>
</ul>