python new test framework + random tests are required. updated in this fork
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/203. Please join the discussion to help us identify duplicate kata and retire them.
Scala translation
C Translation (author inactive).
Python update (new testing framework + random tests)
Language: C++Test suit missing the required header std::vector.
std::vector
Find two typos:
No random tests.
The test cases don't cover the case where arr2 has an index that is out of bounds in arr1, so, for the kata, this code passes -
arr2
arr1
function findArray(arr1, arr2){ // solution return !arr1.length || !arr2.length ? [] : arr2.map(n => arr1[n]); }
while it shouldn't.
There is a test case in the description that states -
For arr1 = [0, 3, 4], arr2 = [2, 6] find_array returns [4]
If you run the code above, for this case, you would get - [4, undefined], as shown in this bin.
[4, undefined]
The correct output should be just [4].
[4]
I suggest providing the dictionary so we don't have to manually create it.
Loading collection data...
python new test framework + random tests are required. updated in this fork
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/203.
Please join the discussion to help us identify duplicate kata and retire them.
Scala translation
C Translation (author inactive).
Python update (new testing framework + random tests)
Language: C++
Test suit missing the required header
std::vector
.Find two typos:
No random tests.
The test cases don't cover the case where
arr2
has an index that is out of bounds inarr1
, so, for the kata, this code passes -while it shouldn't.
There is a test case in the description that states -
If you run the code above, for this case, you would get -
[4, undefined]
, as shown in this bin.The correct output should be just
[4]
.I suggest providing the dictionary so we don't have to manually create it.