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.
Agreed. Can we please remove these test cases.
You cannot break multiple pieces simultaneously
It would have made more sense if we had to compute the sample variance not the variance https://en.wikipedia.org/wiki/Variance#Sample_variance
are you saying that 13164036458569648337239753460458722910223472318386943117783728128 is not a perfect number?
I agree that validating input is a good coding practice, but in this kata it seems a bit random. You can pass the tests while your code can still except invalid squences, for instance containing floats which will silently be casted to ints. An talking about good coding practices, if you want write an algo that should operate on a list of numbers, why not accept only a list in the first place? Converting a string to a valid squence of ints should be a seperate function.
Should non valid squences really be part of this kata? It add just an ugly if statement, don't really see the point.
"My below solution is to leave the "state" of the locker unchanged if the number of locker is a multiple of the run." I would say it's the other way around, i.e. on the 7th run he only alters the state of all multiples of 7. But I agree that kata description is a bit confusing.
This comment is hidden because it contains spoiler information about the solution
I agree that from reading the description it's clear what's expected. However, one usually defines distance from average as x-average, i.e. if x>average the difference is positive. I would flip it around (-/+ -> +/-) and then everything shoul be cristal clear.
test for performance as well
difference is defined in unintuitive way. it should be i-average instead of average-i
Add a performance test
Make the test cases more challenging