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.
Almost did the same thing...but I changed the trait bounds on
array_diff
to also require thatT
implement theCopy
trait.Then I used
iter
andcopied
instead of just usinginto_iter
like I should have...because I initially misspelledinto_iter
while trying this exact thing :PYes, but array sizes are quite small in test cases, so creating additional structures can be less productive in this specific case.
This code has O(n*m) runtime as for each element we have to re-scan in b from scratch.
nvm it was just a typo.
This compiles and runs perfectly. Could you copy your code here?
i tried this and kept getting an error when
a[]
was emptyGenius!
Interestingly there's no test for this. My code was essentially your code without
rev()
and it still passed.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution