AlgoDaily Solution
1Locked, only available for premium members.
Community Solutions
Community solutions are only available for premium users.
Access all course materials today
The rest of this tutorial's contents are only available for premium members. Please explore your options at the link below.
xxxxxxxxxx
30
var assert = require('assert');
var merge = function(nums1, m, nums2, n) {
// Enter your code here
return nums1;
};
try {
assert.deepEqual(
merge([1,2,3], 3, [2,5,6], 3), [1,2,2,3,5,6]
);
console.log(
'PASSED: ' +
"merge([1,2,3], 3, [2,5,6], 3) should return '[1,2,2,3,5,6]'"
);
} catch (err) {
console.log(err);
}
try {
assert.deepEqual(merge([1,10,55,66], 4, [21,48,68,80], 4), [1,10,21,48,55,66,68,80]);
console.log(
'PASSED: ' + "merge([1,10,55,66], 4, [21,48,68,80], 4) should return '[1,10,21,48,55,66,68,80]'"
);
} catch (err) {
OUTPUT
Results will appear here.