Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
sorry for necro-replying
Can you comment on my solution, which benchmarks around 4 times faster than either yours or OP's solution? I tried to avoid iterating over anything more than once, and to avoid allocations where possible
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.
Fascinating work!
I wrote like 80,90 lines of code to get this passed while this guy used only few lines.
I wish I can code like you one day
why is this so highly voted? it's iterating over every string 26 times, once for every character in the alphabet. can someone explain?
smart
's' => acc *= acc
......
purely math again
This comment is hidden because it contains spoiler information about the solution