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.
This was, by far, the most enjoyable kata I've done so far.
I mean the solution I got is not the best, it could be improved in many ways(refactor and remove most ifs).
But the enjoyment of seeing "104 passed" made me shed a tear and I immediately clicked "Submit" :)
Took me 4 sittings, and by the end I could parse some of whitespace by looking at it.
Again: the most enjoyable. By far.
could you assist me with the solutions?
This is probably the most satisfying kata I've completed so far. Took me most of the sunday to finish, but I'm glad I did. I had most problems with
can
feature and had to google a bit, but finally I solved it. Thank you jhoffner, as this was absolutely amazing excersize.This comment helped me not to create a procedure to get network/broadcast addresses of network. It felt like an overkill for 7kyu kata, so I'm glad You pointed this out :)
I'm surpised this isn't the top result, it's the fastest solution I've found:
1.58 µs ± 13.9 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
vs the top solution (in best practices):
1.83 µs ± 23.9 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
This comment is hidden because it contains spoiler information about the solution
Given that the task is very specific I'd say it is, as it is performant and the code is readable.
If you had to, for example, generate neighbors up to a variable distance
n
received as a parameter of the function, that would be a different story.