1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 11:21:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part1

This commit is contained in:
2022-03-27 20:37:52 +08:00
parent 8e542045d1
commit c554fc6908
1285 changed files with 108123 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<p>给你一个整数数组&nbsp;<code>arr</code>,请你帮忙统计数组中每个数的出现次数。</p>
<p>如果每个数的出现次数都是独一无二的,就返回&nbsp;<code>true</code>;否则返回 <code>false</code></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>arr = [1,2,2,1,1,3]
<strong>输出:</strong>true
<strong>解释:</strong>在该数组中1 出现了 3 次2 出现了 2 次3 只出现了 1 次。没有两个数的出现次数相同。</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>arr = [1,2]
<strong>输出:</strong>false
</pre>
<p><strong>示例 3</strong></p>
<pre><strong>输入:</strong>arr = [-3,0,1,-3,1,1,1,-3,10,0]
<strong>输出:</strong>true
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= arr.length&nbsp;&lt;= 1000</code></li>
<li><code>-1000 &lt;= arr[i] &lt;= 1000</code></li>
</ul>