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.
Ah, that's the bit in the description I missed then. Thanks.
That seems...arbitrary? Or maybe it just makes this particular kata seem arbitrary in terms of what it is after.
You have to reduce the fraction first:
16/6 = 8/3
So, I'm confused by something basic in terms of what this is asking, as I don't even understand the first example given. Hopefully by walking through my thought process, someone can spot my error and clarify for me:
Taking the first example,
expand(1,2)
, the answer we're given is65/24
. If I do the math by hand I see I can get this sequence of fractions by stopping atn = 4
:which when summed gives me the result provided in the example:
So, assuming I've got this much right, if we are supposed to return a value as soon as we calculate a numerator with as many or more digits as specified by the second argument, in this case
2
, shouldn't the answer to this actually be16/6
, given by expanding out only ton = 3
?Considering I'm the first person to mention this I can only imagine that my understanding or calculations are somehow mistaken. Any help would be appreciated--thanks!
I wanted to give this a point as both a best practice as well as clever, but I guess the two are mutually exclusive.
I screwed up the naming, please look at this one instead: https://www.codewars.com/kata/reviews/56a333e21cf4a8a66300003b/groups/5a9d69fa389820aa00002340
I screwed up the naming, please look at this one instead: https://www.codewars.com/kata/reviews/56a333e21cf4a8a66300003b/groups/5a9d69fa389820aa00002340