Ad
  • Default User Avatar

    The example inputs all show Ranges, but you've specified that the input argument should be an array. Change this, and perhaps provide an example of a non-Range input.

    Also, you may want to change the wording on the correct output format to emphasize that you want the values in sorted ascending order, rather than in the same relative ordering of the input array.

  • Default User Avatar

    Well shoot. I definitely went for the easy Hash solution. Kudos for not letting the Hash take the place of an actual algorithm

  • Default User Avatar

    Like a lot of the regex based solutions at the top, but mine performs just 2 passes (one for each op level) through the string, rather than restarting the regex from the beginning on every single reduction step.

  • Default User Avatar

    Given how weak the type system is, it's almost always safer to use the stricter === check. If the sorting fails, that's a good indication that you need to examine your input to determine why you're trying to sort an array of mixed strings and ints.

  • Default User Avatar

    Good point, that's correct.