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.
Ruby needs random tests.
Function.prototype.bind
At least, I hope I meant that. It's been four years ..
What's that native solution?
the description is missing JS code blocks
I can write the method as find(numbers,range) but of course I don't know how to make it object oriented so that the numbers are not fed into the method with its arguments but somehow magically arrive while the method itself only has the single range number in its arguments. Can anyone share with me how the numbers array arrives at the find(range) method? Is there some trick in the constructor method I don't know? I feel as though I've solved the programming problem but can't get it tested because I don't know how to turn the thing into a class. Javascript.
Man, it's insanely good!
What language? JavaScript seems to have random tests.
Changed to non-negative.
Needs random tests
(Ruby)
+1, should really be a method with two parameters
Description said:
For simplicity sake you can assume that all the numbers will be positive integers
But in the random tests, the given array contains
0
, 0 is not positive integer.(JS)(JS)
Making it a class has absolutely no added value over making it a plain function of two arguments.
Don't.
Just curry it if you want to be able to easily partially apply it. ( JS also has a native solution for that, but currying has a certain elegance. )
eval is disabled.
They all can do slightly different things after the evaluation, but if you just throw in a string of math, they output the answer.
https://4loc.wordpress.com/2009/05/29/eval-module_eval-and-instance_eval/
Loading more items...