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.
What was it, please say it :)
Done.
Yes, you are correct. My intention in the first place was to force lazy people to use proper error handling, instead of only
error
, which is bad style almost always. ;)mtthw123, after typing that bit a few times, and feeling like it was giving too much away, I ended up adding a couple more example test cases, one in which the vectors were not same-length, then mention that it holds a clue to the correct solution (or a correct solution).
(= (vector-affinity [6 6 6 6 6 6] [6]) (float (/ 1 6))
Just since here obviously the second vector is shorter, and the equality to (float (/ 1 6)) illustrates that the larger of the two is used as the denominator.
What are you thoughts on that?
I hadn't thought of that, but it makes perfect sense. I'll update the description with that. Thanks!
This comment is hidden because it contains spoiler information about the solution
Added. Thanks, both of you!
And while we're at it, lets check arbitrary strings
I struggled a lot with this whilst trying to edit the code but I thought I had ironed it all out.
It should be fixed now? This is a problem with the editor, automatic indentation and tabbing insert different characters.