1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-12 02:41:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
leetcode-problemset/leetcode-cn/problem (Chinese)/不同三位偶数的数目 [unique-3-digit-even-numbers].html
2025-04-03 23:09:51 +08:00

55 lines
2.0 KiB
HTML
Raw 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>digits</code>,你需要从中选择三个数字组成一个三位偶数,你的任务是求出&nbsp;<strong>不同&nbsp;</strong>三位偶数的数量。</p>
<p><strong>注意</strong>:每个数字在三位偶数中都只能使用&nbsp;<strong>一次&nbsp;</strong>,并且&nbsp;<strong>不能&nbsp;</strong>有前导零。</p>
<p>&nbsp;</p>
<p><strong class="example">示例 1</strong></p>
<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">digits = [1,2,3,4]</span></p>
<p><strong>输出:</strong> <span class="example-io">12</span></p>
<p><strong>解释:</strong> 可以形成的 12 个不同的三位偶数是 124132134142214234312314324342412 和 432。注意不能形成 222因为数字 2 只有一个。</p>
</div>
<p><strong class="example">示例 2</strong></p>
<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">digits = [0,2,2]</span></p>
<p><strong>输出:</strong> <span class="example-io">2</span></p>
<p><strong>解释:</strong> 可以形成的三位偶数是 202 和 220。注意数字 2 可以使用两次,因为数组中有两个 2 。</p>
</div>
<p><strong class="example">示例 3</strong></p>
<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">digits = [6,6,6]</span></p>
<p><strong>输出:</strong> <span class="example-io">1</span></p>
<p><strong>解释:</strong> 只能形成 666。</p>
</div>
<p><strong class="example">示例 4</strong></p>
<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">digits = [1,3,5]</span></p>
<p><strong>输出:</strong> <span class="example-io">0</span></p>
<p><strong>解释:</strong> 无法形成三位偶数。</p>
</div>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>3 &lt;= digits.length &lt;= 10</code></li>
<li><code>0 &lt;= digits[i] &lt;= 9</code></li>
</ul>