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.
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
.I was using /n instead of \n and got confused for a good 5 minutes, fml
I had a feeling that I said something like this in my head, but was unaware that it would work as kata.
Good job.
xD
Whilst this solution does pass the test it has changed the parameter from a const. This would be considered bad practice as it edits the original value.
had a spasm reading this.
nice catch, didn't see it at first not gonna lie.
My reaction to this code was my profile pic.
bird bird bird bird bird bird bird bird bird bird bird bird
This is just a list comprehension with string interpolation inside a join call, it is perfectly readable.
For smaller lists, you simply don't think about performance:
linear or quadratic isn't going to make much difference for a list with 100 elements.
You need at least 1000 elements to make it useful.
However I think it is a good idea to show best practices in simple katas, so the harder ones will become easier to tackle.
I do realize that for big lists, creating a set would end up in performance improvement, but for smaller ones isn't creating a set a bit of a downgrade? cause we have to basically add an operation (set(arr)) to the whole thing. Maybe I'm just overthinking this...
Loading more items...