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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
That makes more sense.
This comment is hidden because it contains spoiler information about the solution
Might be the simplest and fastest solution.
This solution counts the chars for every char. It's redudant work being done. Might be slow.
I honestly do not remember. Presumably the compiler complained when I implemented it with the reference I create in the match pattern, so I explicitly re-borrowed to work around that. Just a guess. There's nothing about the code that stands out to me as actually needing the re-borrow (actually, it perhaps has to do with lifetimes: the initial reference only lives until the
if let Some()...
expression leaves scope. Although, from my understanding, immutable borrows areCopy
, so this shouldn't really be a problem)Why do you use
&*l
instead of justl
? For me both is working.You wanna say, there should be more tests and maybe random tests?