Class Solution
java.lang.Object
g1401_1500.s1447_simplified_fractions.Solution
1447 - Simplified Fractions.<p>Medium</p>
<p>Given an integer <code>n</code>, return <em>a list of all <strong>simplified</strong> fractions between</em> <code>0</code> <em>and</em> <code>1</code> <em>(exclusive) such that the denominator is less-than-or-equal-to</em> <code>n</code>. You can return the answer in <strong>any order</strong>.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> n = 2</p>
<p><strong>Output:</strong> [“1/2”]</p>
<p><strong>Explanation:</strong> “1/2” is the only unique fraction with a denominator less-than-or-equal-to 2.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> n = 3</p>
<p><strong>Output:</strong> [“1/2”,“1/3”,“2/3”]</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> n = 4</p>
<p><strong>Output:</strong> [“1/2”,“1/3”,“1/4”,“2/3”,“3/4”]</p>
<p><strong>Explanation:</strong> “2/4” is not a simplified fraction because it can be simplified to “1/2”.</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= n <= 100</code></li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
simplifiedFractions
-