Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Whoa, challenging kata! Thanks to the author for putting it together.
I see there are some comments expressing some dissatisfaction with the emphasis on math, and others defending it as not too math-heavy.
I will say, I had a great time learning new math for this problem, but it can also be challenging to estimate how easy or difficult something is for a newcomer, especially if we already have advanced knowledge of it. We're more likely to underestimate its difficulty than overestimate.
So, if anyone is struggling with this kata, and is getting discouraged by comments saying how easy it is after using pen and paper (I still couldn't get it after using pen and paper!), then maybe this will give you enough of a hint to make the problem solvable without giving too much away:
If a fraction's denominator doesn't share any factors with 10, then it is guaranteed to repeat (i.e. no need to guard against patterns like "ABCDCDCD", since "A" is guaranteed to come around again, which means that so will "BCDCDCD"). This was the main reason my solution timed out, and I don't know how you'd know this fact unless you're pretty well-versed in number theory already.
No need to dive deep into stack overflow and learn about Euler's Totient formula -- it was great learning this, but it's not necessary for this kata.
All that being said, hope you enjoy this kata and keep a good attitude. Not marking this comment as a spoiler since it doesn't give away anything about the algorithm, but just avoiding some dead-ends that I ran into due to a lack of number theory knowledge.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution