Ad
  • Custom User Avatar

    My solution is similar to yours. But I prefer to not hardcode a lot of [-4..-1]. Better to create helper method, because if requirements changes - you should edit only one helper method instead of looking through all the source codes.

  • Default User Avatar

    Sorts incorrectly if the name contains a dash. e.g. A-B-1234 will be after B-A-1234. I wouldn't recommend making any assumptions on name.