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.
no
Does
fitnesses
always add up to 1.0?It also creates
[bags[0],bags[1],bags[2]
,[bags[6],bags[7],bags[8]]
,[bags[i+3]]
and[bags[i+5]]
( if they aren't optimised away ).Kata's don't need to describe reality, they just need to propose problems (description updated).
Fixed
Fixed.
Absolutely! In fact, I couldn't quite understand it all until I switched to classes and trimmed all that unneccessary code.
added tests to check for this.
To be fair though, anything not an integer (and non-numbers) should be discarded right away because they're not even an integer.
If you're caring about these kind of low-level things in a high-level language in JS it probably isn't a good idea. (the compiler will optimize them for you anyways, and +20% performance doesn't mean anything in all cases except performance-tight loops). By the same argument all higher-order functions should be scratched because they're probably never going to match the performances of for loops (even though it's usually, again, +20% or something in practice).
Besides, intermediate variables means nothing to a compiler, they're smart enough to notice this and chain them together anyways.
Problem is in Python3 this code wouldn't work because xrange in Python2 was changed to range in Python3.
Thanks, corner testcase added.
data less than 3 or data more than 60 accounted for 1/5 of the proportion
You're absolutely right, sorry for that. Give it a try now, should be sorted. And thanks for your positive feedback! [=
I thank you for the suggestion and I am happy you enjoyed the kata! You are right, the time needed is not always the same but I always try to adapt the time to the used language. When I validate the kata I try to stay below half the possible time of the given language before timing out but it depends of the solution each Codewarrior is using. Nevertheless I will remember your suggestion for a next kata. Thanks once more!
I'm glad you enjoyed it
Loading more items...