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.
This comment is hidden because it contains spoiler information about the solution
Holy moly, this is like code bowling (the opposite of code golf where you want the smallest amount of code possible, instead, you want to multiply the amount of code for no good reason).
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 is not best practice. Why iterate over the entire set TWICE? If there are a million elements and the third one is odd, you can be done by the third element, but you're going to do 2 million loops. Whoops.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
You're iterating over the entire set twice? What if there are a million elements, and it starts
{ odd, odd, even }
? This is neither clever nor best practice.This comment is hidden because it contains spoiler information about the solution
Why would you do
ToList()
? Arrays areIEnumerable
and you can go directly toCount()
from them.