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.
Modifying input still causes problems in sample tests (at least in JS version).
Still true in sample tests.
count
isn't properly tested: I mistyped it but my solution passed.the test suite needs fixed tests too...The fixed tests should be at the beginning of the test suite, but only edge cases are present. So needs more fixed tests.(ruby)
All's fine now.
Try again.
Nope. I didn't modify the
target
, and made a copy ofsource
, but a couple of such cases were generated almost on every attempt.Edit: I still get such cases wrong.
Edit 2: in case of
target=[]
, the expected result issource
without its last element. Considering how all fixed tests withtarget=[]
have 1-element-longsource
array, the reference solution passes because it copiesn-1
elements fromsource
totarget
which happens to be exactly0
elements.Edit 3: confirmed, the reference solution returns first
n-1
elements ofsource
array in casetarget
is empty.Not anymore.
Not anymore.
I think this one is related to the input mutation problem, is it?
Inputs can be modified in Ruby.
Inputs can be modified in JavaScript.
JavaScript:
This was fixed.
.
There is nothing in target, so all positions are the last position. So nothing should be added. So the expected output should be an empty array.
Loading more items...