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.
nice
Nice approach :)
Any votes for my solution? lol
Its not work with Unicode string. Just test "вася".
I definitely overthank 😬
I liked this approach!!
Not really that bad, Golang has amortized cost of append() -> O(1)
But sure, make the array beforehand is much better in that case
This code, and all the other codes that use string slicing, do not work with general unicode strings like "日本語".
You can remove the
if
, keep onlystr += "_"
and loop tolen(str)-1
.The performance of this method is very low, and the append method causes the underlying array to be reallocated continuously.