1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/最简分数 [simplified-fractions].html
2022-03-29 12:43:11 +08:00

36 lines
1.2 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>给你一个整数&nbsp;<code>n</code>&nbsp;,请你返回所有 0 到 1 之间(不包括 0 和 1满足分母小于等于&nbsp;&nbsp;<code>n</code>&nbsp;<strong>最简&nbsp;</strong>分数&nbsp;。分数可以以 <strong>任意&nbsp;</strong>顺序返回。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>n = 2
<strong>输出:</strong>[&quot;1/2&quot;]
<strong>解释:</strong>&quot;1/2&quot; 是唯一一个分母小于等于 2 的最简分数。</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>n = 3
<strong>输出:</strong>[&quot;1/2&quot;,&quot;1/3&quot;,&quot;2/3&quot;]
</pre>
<p><strong>示例 3</strong></p>
<pre><strong>输入:</strong>n = 4
<strong>输出:</strong>[&quot;1/2&quot;,&quot;1/3&quot;,&quot;1/4&quot;,&quot;2/3&quot;,&quot;3/4&quot;]
<strong>解释:</strong>&quot;2/4&quot; 不是最简分数,因为它可以化简为 &quot;1/2&quot;</pre>
<p><strong>示例 4</strong></p>
<pre><strong>输入:</strong>n = 1
<strong>输出:</strong>[]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= n &lt;= 100</code></li>
</ul>