Exercises/#79 Fraction to Recurring Decimal
#79

Fraction to Recurring Decimal

MediumπŸ”’ Math & Numbers
90 XP

Problem

Given numerator and denominator, return the fraction as a string. If the decimal part is repeating, enclose the repeating part in parentheses.

Examples

Input: numerator=1, denominator=2
Output: '0.5'

Input: numerator=1, denominator=3
Output: '0.(3)'

Input: numerator=4, denominator=333
Output: '0.(012)'
mathhash-mapsimulation
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

79 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features