Ad
  • Default User Avatar

    awesome thank you so much for your feedback) I did it like that because the orderby wasn't storing how I thought it ought to. I really enjoyed reading your solutions thanks again

  • Default User Avatar

    Note that this code makes a new list, then immediately overwrites it with one made by sorting the array descending and copying it to a list, and then immediately sorts it again ascending.

    If the approach to this problem is to be a sort based one, which is an inefficient approach ("why sort a million numbers when all you need are two of them?"), the inefficiency should not be doubled by sorting twice