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
So it was my intention NOT to use any non-integer calls ;)
Unlike
Array.Sort
, this version doesn't change the array that it is passed.We could change the
int[]
toIEnumerable<int>
without any other changes and this would continue to support arrays while allowing other collection types and queries to be passed to it --Array.Sort
works only on Arrays.This version is written as an expression-bodied member, the
Array.Sort
version cannot be written as an expression-bodied member -- it requires a code-block for the method body and a return statement.Yes,
Array.Sort
performs better, but this version performed well enough to pass the tests and has all the above benefits. I'll offer that best-practice is at somewhat subjective, but there are tangible reasons to appreciate this implementation.It seems that nowadays new programmers almost forgot that performance is a valuable feature of every code.