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.
All the logic that I have made for solving the problem too, but written laconically in one line, I really like this style.
Agreed. Since we know that we have to check the first letter of the name, then we should lower case the first letter ONLY - lower casing the WHOLE name is a waste of memory and processing. Also, string has a method called ToLowerInvariant which can be faster than regular ToLower method, since it doesn't lower case considering the culture code.
This comment is hidden because it contains spoiler information about the solution
at no point does he save the ToLower name and it is never used for anything then the check so the return will still have match the name you pasted in Upper or Lower
This is less than optimal since it converts the whole name to lower case when we only need to compare the first letter.
I don't think so because if statements are short-circuited(https://stackoverflow.com/a/12554597)
Glad my solution took me hours to write, and is 35 lines. (-_-) To be fair to myself, I was hellbent on preserving the data type and not converting the input to a string. Why? Not sure exactly. But I did it.
what about it?
:o
Use spoiler flag next time, please.
This comment is hidden because it contains spoiler information about the solution
Nice - I think this is the "code-golf" champion!
This breaks when 'other' is not an Array. Other than that, it is a great solution.
This comment is hidden because it contains spoiler information about the solution
done
Loading more items...