educative.io

My solution works every where else except here

Hi, I used tried this code on your code editor, and it showed me that the process was killed:
function mergeArrays(arr1, arr2) {

let output = [];
let i = 0;
let j = 0;
while(i<arr1.length || j<arr2.length){
    if(arr1[i]<arr2[j]){
        output.push(arr1[i])
        i++
    }else{
        output.push(arr2[j])
        j++
    }
}

return output;

}

for some reason in the code editor it returns a “killed process” response, but it runs anywhere else, may i know why?

Hi @SHONUBI_JOYE

I have checked on the platform and it’s working perfectly fine.

Happy learning,