2023-7: Let's Be Rational

A rational number is a number that can be expressed as the quotient of 2 integers p÷q — a numerator p and a denominator q. For example, for 1.5, p and q would be 3 and 2, respectively.

Write code that:

takes a single non-zero positive number argument.

returns a 2-element "integer" result representing the smallest non-zero positive values for p and q respectively

Examples

Implementation

You can also run the tests via ⌘/shift + enter