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.
The solution I tried to implement, but because I didn't know about
cloned()
method had to go with clonning input array into variable -__-This comment is hidden because it contains spoiler information about the solution
Do you know you can fork the solution and see what happens if you remove this part? Just click on
fork
below the code. Rust compiler explains things very well :)This comment is hidden because it contains spoiler information about the solution
Tell me you r a compiler dev without telling me you r a compiler dev
Clever.
I have a similar algorithm. The
entry(idx).or_insert(i)
is unnecessary, you may doinsert(idx, i)
. and thechar
instack
is not needed as well.Nice! I wish
slice::array_windows
was stable, that would let you do something like: