function merge(left = [ 1, 2, 2, 3, 5, 6 ], right = [0, 1, 2, 2, 3, 5, 6 ]) {
let [i, j] = [0, 0];
const result = [];
while(i < left.length || j < right.length) {
if(left[i] < right[j]) {
result.push(left[i++])
} else if (left[i] > right[j]) {
result.push(right[j++])
} else {
if(left[i]) result.push(left[i++]);
if(right[j]) result.push(right[j++]);
}
}
return result;
}
merge()