1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/统计位数为偶数的数字 [find-numbers-with-even-number-of-digits].html
2022-03-29 12:43:11 +08:00

34 lines
973 B
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>给你一个整数数组&nbsp;<code>nums</code>,请你返回其中位数为&nbsp;<strong>偶数</strong>&nbsp;的数字的个数。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>nums = [12,345,2,6,7896]
<strong>输出:</strong>2
<strong>解释:
</strong>12 是 2 位数字(位数为偶数)&nbsp;
345 是 3 位数字(位数为奇数)&nbsp;&nbsp;
2 是 1 位数字(位数为奇数)&nbsp;
6 是 1 位数字 位数为奇数)&nbsp;
7896 是 4 位数字(位数为偶数)&nbsp;&nbsp;
因此只有 12 和 7896 是位数为偶数的数字
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>nums = [555,901,482,1771]
<strong>输出:</strong>1
<strong>解释: </strong>
只有 1771 是位数为偶数的数字。
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= nums.length &lt;= 500</code></li>
<li><code>1 &lt;= nums[i] &lt;= 10^5</code></li>
</ul>