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)/完全平方数 [perfect-squares].html
2022-03-29 12:43:11 +08:00

27 lines
904 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>给你一个整数 <code>n</code> ,返回 <em>和为 <code>n</code> 的完全平方数的最少数量</em></p>
<p><strong>完全平方数</strong> 是一个整数,其值等于另一个整数的平方;换句话说,其值等于一个整数自乘的积。例如,<code>1</code><code>4</code><code>9</code><code>16</code> 都是完全平方数,而 <code>3</code><code>11</code> 不是。</p>
<p>&nbsp;</p>
<p><strong>示例&nbsp;1</strong></p>
<pre>
<strong>输入:</strong>n = <code>12</code>
<strong>输出:</strong>3
<strong>解释:</strong><code>12 = 4 + 4 + 4</code></pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>n = <code>13</code>
<strong>输出:</strong>2
<strong>解释:</strong><code>13 = 4 + 9</code></pre>
&nbsp;
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= n &lt;= 10<sup>4</sup></code></li>
</ul>