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.
I know I'm 2 years late, but his code is about ~3 faster. Tested it with 1 and 10 million executions.
Oh, yes... I see...
but the return value will be retuned as an integer. it won't convert to a char. that's not what you want the function to do
Yeah
Since the return value of the function is
char
, you can simply replacechar(i)
withi
.You could have used
init(repeating: String, count: Int) -> String
in place ofrepeatElement
nice outside the box thinking
This is a less than ideal solution because it would count words that have "good" as a substring, but this isn't tested.
👍
clever!
Me too - just remove 'characters' from 'return str.characters.enumerated().map ' and it works ;)
This solution shows me the error "Value of type 'String' has no member 'capitalized'"
Thanks, the problem is on my side then
390 guys passed the C++ kata (see the top of the page), I just tried a few solutions and all worked fine. I don't see any mix in the vectors.
C++ :
The answer can't be right no matter what you do. The "cd" and "art" vectors are mixed up in the tests. So the "&lstOfArt" and "&categories" vectors get to the function in the wrong order.