Ad
  • Custom User Avatar

    I like the idea of using the first words length as an initializer. In mine I assigned a -1 to start and then had to have an if statement in an each loop to get the initial, this would remove about two lines from mine. Nice!

    Similarly I'd recommend using each instead of a while loop.

    Also I think I'd use words.count for the array size over length so as not to confuse a maintainer if I was using this in prod code.

  • Custom User Avatar

    Only thing I dislike about this, is the RubyDocs say sort is not guaranteed to be stable. It may work for the kata just fine though.