// This challenge can be solved by creating a new
// array, then looping through one of the arrays and
// adding each element with the corresponding element
// in the other array, and storing this sum in the new array.
const assert = require('assert');

const ArrayMatching = strArr => {
  const arr1 = strArr[0].replace(/[[]]/g, '').split(',');
  const arr2 = strArr[1].replace(/[[]]/g, '').split(',');

  const long = arr1.length >= arr2.length ? arr1 : arr2;
  const short = long === arr1 ? arr2 : arr1;

  const summed = long.map((n, i) => Number(n) + Number(short[i] || 0));
  return summed.join('-');
};

const a1 = '[5, 2, 3], [2, 2, 3, 10, 6]'; // input
// const r1 = '7-4-6-10-6'; // output

const t1 = ArrayMatching(a1);
assert(t1);

const a2 = '[1, 2, 1], [2, 1, 5, 2]'; // input
const r2 = '3-3-6-2'; // output

const t2 = ArrayMatching(a2);
assert(t2, r2);

@@ -689,25 +689,24 @@
 ; // output%0A
-%0A
 const t1 = A
@@ -779,24 +779,27 @@
 '; // input%0A
+// 
 const r2 = '
@@ -818,17 +818,16 @@
  output%0A
-%0A
 const t2
@@ -861,11 +861,85 @@
 t(t2
-, r2
+);%0A%0A// t1 = ArrayMatching(%5B1, 2, 1%5D, %5B2, 1, 5, 2%5D);%0Aconsole.log(t1);%0Aassert(t1
 );%0A

update tests