
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
No scary math, just apply elementary math knowledge. Still remember how to perform a <i>long division</i>?
Try a long division on 4/9, the repeating part is obvious. Now try 4/333. Do you see a pattern?
Notice that once the remainder starts repeating, so does the divided result.
Be wary of edge cases! List out as many test cases as you can think of and test your code thoroughly.