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.
Looking at your solution it looks like you just like to add documentation for the sake of documentation, even when it results in illegible code and a ton of duplication/stating what is obvious even to novices. I won't claim the top solution to be best practices, but less is more in this case when the solution can be whittled down to a single standard lib function call.
I brute forced my way with programming constructs through this one but seeing the answers that took the far superior mathematical approach really opened up my eyes. Excellent kata to showcase a time where math really does matter (specifically knowledge of math formulas).
The golang version only covers array types of
[]string{}
andmake([]string, 5, 5)
but not for[5]string
. If you try to use[5]string
the test fails.Instructions were not clear about the random sets of data containing towns not found in the
strng
parameter, as well as expecting-1
to be returned rather than0
when it happens. Was great debugging practice though.This comment is hidden because it contains spoiler information about the solution