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.
After submitting my katas, I usually compare my code to others' solutions. Looking for improvements to my own solution, maybe learn something new, or to gloat about how my simple loops and logic run circles around all the garbage Linq code I see here. Horrendous!
I came across your solution and was startled to see it is nearly identical to mine. I was super-surprised to see you using the ASCII offset method like me. One thing I do is test performance of my code compared to others' code. I have a timing system set up so I can copy someone's kata to my system and have the test started in about 10 seconds from seeing their code.
So I naturally compared mine to yours and yours was ~9-10% faster. I didn't understand why, so I started looking at both with a magnifying glass.
Three differences: your const is declared global to the class while mine is local to WordScore, your WordScore is a class method / mine is a local function, and your Split() is parameterless while mine is Split(" ").
The first two differences made no difference...it was the Split that split the difference in our codes' executions times.
Learn something new everyday!
The entire string shouldn't necessarily be lowered either; chars could be lowered as you go. It's pointless lowering the whole of
aABCDEFGHIJKLMNOPQRSTUVWXYZ
if you're going to detect a non-isogram on str[1]The only limit is your PC memory
This comment is hidden because it contains spoiler information about the solution
Yes
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution