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.
That's actually a much better idea, and should really be trivial to add.
You could even I think quite easily add statistics like speed percentile for the given language. That would make unusually slow solutions stand out and lead people to question why that might be.
That being said, I don't think this site sees a lot of development so this might be a fool's hope :P
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Fwiw, I believe ToLowerInvariant should be preferred aswell, since ToLower is apparently slow for some reason. 6 years later, but still, maybe someone will read this ;)
In case anyone is wondering the same: no, this is not a good solution. Pointlessly creating a range (plus the empty select which does nothing at all) when you could just for-loop over the numbers manually, simply to force the solution into a single line, is wasteful and inefficient.
It looks slick but it does double the work that is needed (actually more since you don't really need to check every number from 1 to n, there is a sqrt(n) solution, but for what its trying to achieve this is a bad way of going about it. No offense to the authors intended!).
Use Linq responsibly, kids!
Exactly this. If you just sort both and then do the multiplications manually, you can quit early, whereas this could potentially do hundreds of thousands of unnescessary calculations even though the very first element might already be a dud. Linq is very suboptimal here.
4 years later, but still somebody might find this useful :D
This comment is hidden because it contains spoiler information about the solution
Feels like the "Best Practices" button should be restricted or disabled entirely, since a whole bunch of people will upvote anything that's crammed into a neat one-liner as "Best Practices" even if it's horrendously inefficient.
Not that my code is exactly brilliant, but from the comments on a lot of these I get the feeling that many people are learning terrible habits.
This comment is hidden because it contains spoiler information about the solution
It's been a minute, but if you're still interested, try looking up "method groups".
They are essentially a way of telling the compiler: 'Hey, here's the name of a method with multiple overloads, please find the one with the correct signature for this scenario'.
At least that is my probably flawed understanding.
I could win a gold medal in the olympic 100m dash, but the other guys keep cheating by running faster than me. Life sure is cruel.