limit, return every fraction strictly between 0 and 1 that is in lowest terms and whose denominator does not exceed limit.
Write each fraction as a string "numerator/denominator", such as "3/4". Each value must appear exactly once, in its reduced form.
The fractions may be returned in any order.limit=4 → ['1/2', '1/3', '1/4', '2/3', '3/4']
Denominators 2, 3 and 4 give 1/2, 1/3, 2/3, 1/4 and 3/4; 2/4 reduces to 1/2 and is not listed again.
limit=2 → ['1/2']
The only fitting fraction is 1/2.
limit=1 → []
With denominator 1 there is no fraction strictly between 0 and 1, so the list is empty.
limit=4
['1/2', '1/3', '1/4', '2/3', '3/4']
Run checks the first 3 tests in your browser. Submit checks all 25 tests on the server, hidden ones included.