1 Star 41 Fork 18

小墨/力扣题库(完整版)

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
丑数 [ugly-number].html 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
小墨 提交于 2025-01-09 20:29 +08:00 . 批量更新数据
<p><strong>丑数 </strong>就是只包含质因数&nbsp;<code>2</code><code>3</code><code>5</code>&nbsp;&nbsp;<em>&nbsp;</em>整数。</p>
<p>给你一个整数 <code>n</code> ,请你判断 <code>n</code> 是否为 <strong>丑数</strong> 。如果是,返回 <code>true</code> ;否则,返回 <code>false</code></p>
<p>&nbsp;</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 没有质因数。</pre>
<p><strong>示例 3:</strong></p>
<pre>
<strong>输入:</strong>n = 14
<strong>输出:</strong>false
<strong>解释:</strong>14 不是丑数,因为它包含了另外一个质因数&nbsp;<code>7 </code>
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>-2<sup>31</sup> &lt;= n &lt;= 2<sup>31</sup> - 1</code></li>
</ul>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/coder-xiaomo/leetcode-problemset.git
git@gitee.com:coder-xiaomo/leetcode-problemset.git
coder-xiaomo
leetcode-problemset
力扣题库(完整版)
master

搜索帮助