Ad
  • Default User Avatar

    I'm not a fan of testing the length condition last since that is a very fast check regardless of the size of the input. This solution also traverses the input four times, when a single pass is sufficient with other solutions.

    It is concise, but I'm not sure I would consider it good.