Description
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating, enclose the repeating part in parentheses.
Examples
Input:
numerator = 1, denominator = 2Output:
"0.5"Explanation:
1/2 = 0.5
Input:
numerator = 2, denominator = 3Output:
"0.(6)"Explanation:
2/3 = 0.666... with 6 repeating.
Input:
numerator = 4, denominator = 333Output:
"0.(012)"Explanation:
4/333 = 0.012012... with 012 repeating.
Constraints
- •
-2³¹ ≤ numerator, denominator ≤ 2³¹ - 1 - •
denominator != 0