Ad
  • Default User Avatar

    The repeated access to string is cache friendly, so has a good chance to be stupid fast.
    On the other hand, memory allocations are stripped to (what seems to be) a minimum.
    The clever avoidance of count and no intermediate collection to store the counting is appealing to the audiance. :-)
    Also, codewars community tend to favor 'less code' approach. :-))
    That's my understanding, but would like to hear someone more experienced in Rust.