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.
Yep, I knew my own solution was over-complicated, but I just couldn't get my thoughts straight haha. Great solution you present here! :)
It was nowhere said that epsilon should be less than 1.0:-) Nevertheless I modified the random tests. Thanks!
In the random test cases it looks like sometimes an
epsilon
greater than 1.0 was passed in. Is that a bug in the testing suite for this kata? Or am I mistaken?//edit: I was using this kata with Golang.
The sorted key parameter receives a tuple from
weight_key
which contains two values: First the weight-value, and second the string value itself.In your example using "11" and "20000" the keys are thus (2, "11"), and (2, "20000"). Hence the weigh-values are equal, but the string values differ and are sorted accordingly.
I hope this clarifies it.