Code AnalysisHard 50s
Trace: Merge Two Sorted
What is printed?
Starter code
function merge(a,b){let r=[],i=0,j=0;
while(i<a.length&&j<b.length)r.push(a[i]<=b[j]?a[i++]:b[j++]);
return r.concat(a.slice(i)).concat(b.slice(j));}
console.log(merge([1,3,5],[2,4,6]).join(''))Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.