2022-03-27 20:37:52 +08:00
< 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 > < / p >
2023-12-09 18:42:21 +08:00
< p > < strong class = "example" > Example 1:< / strong > < / p >
2022-03-27 20:37:52 +08:00
< pre >
< strong > Input:< / strong > n = 2
< strong > Output:< / strong > [" 1/2" ]
< strong > Explanation:< / strong > " 1/2" is the only unique fraction with a denominator less-than-or-equal-to 2.
< / pre >
2023-12-09 18:42:21 +08:00
< p > < strong class = "example" > Example 2:< / strong > < / p >
2022-03-27 20:37:52 +08:00
< pre >
< strong > Input:< / strong > n = 3
< strong > Output:< / strong > [" 1/2" ," 1/3" ," 2/3" ]
< / pre >
2023-12-09 18:42:21 +08:00
< p > < strong class = "example" > Example 3:< / strong > < / p >
2022-03-27 20:37:52 +08:00
< pre >
< strong > Input:< / strong > n = 4
< strong > Output:< / strong > [" 1/2" ," 1/3" ," 1/4" ," 2/3" ," 3/4" ]
< strong > Explanation:< / strong > " 2/4" is not a simplified fraction because it can be simplified to " 1/2" .
< / pre >
< p > < / p >
< p > < strong > Constraints:< / strong > < / p >
< ul >
< li > < code > 1 < = n < = 100< / code > < / li >
< / ul >