Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    So it was my intention NOT to use any non-integer calls ;)

  • Custom User Avatar

    Unlike Array.Sort, this version doesn't change the array that it is passed.
    We could change the int[] to IEnumerable<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.

  • Custom User Avatar

    It seems that nowadays new programmers almost forgot that performance is a valuable feature of every code.