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.
yeah it is not allowed to use the gcd method of the Fixnum class, you have to find the mathematical expression yourself.
Unfortunately, the code is slow: you are checking for every possible number smaller than the smallest value of x and y. That is called "brute force programming" and although it will generate the correct value in time, it is not very efficient for large values of x and y (test cases involve numbers as large as 1.5 billion).
To solve this Kata, you have to find an algorithm that is much more efficient.
No problem, thanks! So is the Kata ready to be approved?
Still an issue? Didn't I add the random tests correctly?
Done!
Added 6 random tests. Take a look and adjust the number of tests or testrange if you like.
Added Coffeescript as well.
PS: I adjusted it for JS, Python, Ruby and Coffeescript. I don't know how to add a line of text including the test case in Haskell
I'm sorry, you were right, it didn't show the input values. I have now adjusted this, although it has come a bit too late for you now. Anyway, thank you for notifying me.
sure, I adjusted it so you now can see the test case
are you sure the test did not specify the test numbers, because it should print the test values before testing your code.
Anyway, I'm glad you find the bug
Correctomundo!
Thank you Bkaes for this most elaborate and clear answer! To be honest, I really did not expect such a long answer, but I'm very happy you took the time to explain in such detail.
I'm unfamiliar with all languages you mention and only recently I started to learn Python, Ruby and Javascript.
If you click on the +button you will see three translations by us three called "find the middle element"-Ruby/Haskell/Coffeescript Translation. When you click on the name of either one of them, there will be a Approval button in the upper right corner (if I remember correctly).
Coffeescript translation added.
Loading more items...