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.
good though
nice
Euclid would be proud of you :D
I knew it must be some mathematical trick.
Your code looks like Python.
Yes, you are right. I was just overthinking. In fact, I am shamelessly using this method in other katas now. Thanks!
It's not a big deal. The numbers would have to be ginormous, certainly far larger than the test cases in this kata, for the recursive gcd to use significant stack depth.
Will this solution not increase the maximal recursion depth to obtain the solution?
damn boi, that's clever af
my self esteem after seeing these 1 line solutions be like "not stonks".
The maximal recursion depth is limited by JavaScript engine. We can rely on it being 10000, some engines allow more, but 100000 is probably out of limit for the majority of them. There are automatic optimizations that help alleviate this (“tail calls optimizations”), but they are not yet supported everywhere and work only in simple cases.
That's true! Thank you!
pure magic that you do not need to look for the minimum value
Awesome!
if anyone is wondering its based on euclidean algorithm
Loading more items...