1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-11 18:31:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
leetcode-problemset/leetcode-cn/problem (Chinese)/出现频率最低的数字 [find-the-least-frequent-digit].html
2025-09-02 22:45:58 +08:00

40 lines
1.2 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

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>n</code>,找出在其十进制表示中出现频率&nbsp;<strong>最低&nbsp;</strong>的数字。如果多个数字的出现频率相同,则选择&nbsp;<strong>最小&nbsp;</strong>的那个数字。</p>
<p>以整数形式返回所选的数字。</p>
<p>数字 <code>x</code> 的出现频率是指它在&nbsp;<code>n</code> 的十进制表示中的出现次数。</p>
<p>&nbsp;</p>
<p><strong class="example">示例 1:</strong></p>
<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">n = 1553322</span></p>
<p><strong>输出:</strong> 1</p>
<p><strong>解释:</strong></p>
<p><code>n</code> 中,出现频率最低的数字是 1它只出现了一次。所有其他数字都出现了两次。</p>
</div>
<p><strong class="example">示例 2:</strong></p>
<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">n = 723344511</span></p>
<p><strong>输出:</strong> 2</p>
<p><strong>解释:</strong></p>
<p><code>n</code> 中,出现频率最低的数字是 7、2 和 5它们都只出现了一次。</p>
</div>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= n &lt;= 2<sup>31</sup> - 1</code></li>
</ul>