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 doesn't even work for large odd lists...
ok now i can sleep peacefully thankyou
While the code is short, it runs through the entire list twice! :Urgh:
It is neither clever nor a best practice.
very inefficient
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
What should I be surprised about? In this solution, we iterate the entire list twice, while on average we only need to check half of the list to find an outlier. We should consider general complexity, not the special case when the list has 3 elements.
Have you benchmarked it? If you haven't, you should and might be surprised.
This solution is 4 times slower than it could be
how is this voted best practices? It iterates through the entire list twice, when in reality most circumstances you don't even have to make one complete iteration of the list. Also, the list is renamed to int which is also pretty bad practice.
Eye candy, but using two loops when you could have used one is not what I would call a "best pracice"
The solution is elegant, but it's definitely not "best practices". Many may be confused by this decision in the top
This comment is hidden because it contains spoiler information about the solution
how can we determine the outlier type from the first 3 elements? can't it be all even or all odd until lets say the 1000th element?
how can we determine the outlier type from the first 3 elements? can't it be all even or all odd until lets say the 1000th element?
Loading more items...