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.

  • Default User Avatar

    why is this so highly voted? it's iterating over every string 26 times, once for every character in the alphabet. can someone explain?