mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 11:21:42 +08:00
add leetcode problem-cn part6
This commit is contained in:
35
算法题(国内版)/problem (Chinese)/丑数 [ugly-number].html
Normal file
35
算法题(国内版)/problem (Chinese)/丑数 [ugly-number].html
Normal file
@@ -0,0 +1,35 @@
|
||||
<p><strong>丑数 </strong>就是只包含质因数 <code>2</code>、<code>3</code> 和 <code>5</code> 的正整数。</p>
|
||||
|
||||
<p>给你一个整数 <code>n</code> ,请你判断 <code>n</code> 是否为 <strong>丑数</strong> 。如果是,返回 <code>true</code> ;否则,返回 <code>false</code> 。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>n = 6
|
||||
<strong>输出:</strong>true
|
||||
<strong>解释:</strong>6 = 2 × 3</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>n = 1
|
||||
<strong>输出:</strong>true
|
||||
<strong>解释:</strong>1 没有质因数,因此它的全部质因数是 {2, 3, 5} 的空集。习惯上将其视作第一个丑数。</pre>
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>n = 14
|
||||
<strong>输出:</strong>false
|
||||
<strong>解释:</strong>14 不是丑数,因为它包含了另外一个质因数 <code>7 </code>。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>-2<sup>31</sup> <= n <= 2<sup>31</sup> - 1</code></li>
|
||||
</ul>
|
Reference in New Issue
Block a user