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 comment is hidden because it contains spoiler information about the solution
Look at the implementation of the strings.ToUpper / strings.ToLower function – there is a loop inside. So that you are using more than 1 loop in your solution.
https://cs.opensource.google/go/go/+/go1.20.4:src/strings/strings.go;l=585
https://cs.opensource.google/go/go/+/go1.20.4:src/strings/strings.go;l=625
What if the string contains runes that are neither uppercase or lowercase (not a letter, but a number or symbol)? unicode considers them neither upper or lowercase. len(str) also returns the number of bytes in the string, not the number of runes.
weird, for me it works in 1100ms, 10 times faster than the limit.
Great solution! I believe we can actually include second 'if' inside the loop and
have a chance to reduce time complexity by up to 50%
oh ! didn't know there was a unicode.IsUpper function
awesome solution
I had a timeout error with this kind os solution...
This comment is hidden because it contains spoiler information about the solution
because it's not a list. Look at the documentation of the fonction generating it.
This comment is hidden because it contains spoiler information about the solution
It's so fast!!
I'd like to know as well
Can you explain how this works?
can i ask why is it bad ?
what implicit coerction means ?
Loading more items...