Ad
  • Default User Avatar

    Having some experience commiting to back-end and middle-end of certain popular programming language compilers - it's not always so simple. The length of the code doesn't necessarily map to the length of machine code. It's a good rule of thumb, but it might not apply in this case.

    These loops are idiomatic and easy to identify by SSA optimization rules.

    There's a comment somewhere here that says it's the fastest solution. I haven't really built it with that in mind, but if it is, I bet it's because it's easy for the runtime/compiler to apply optimizations and vectorize the loops.

    Just looking at them they seem ripe for some optimized SIMD bit magic implementation.

  • Default User Avatar

    I don't think it's over documented, although certainly it could be shorter.
    That can also imply less perf

  • Default User Avatar

    point is the length test shouldn't be on the passed string, but on the final hash-tagged string.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    It can be way longer than 139 characters. Remember that the spaces are not going on the hashtag. Something like this "a" + " ".repeat(200) + "b" should be valid.