We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functionmissingNumbers(arr,brr){// Write your code herevaroArr={};varoBrr={};for(vari=0;i<arr.length;i++){if(!oArr[arr[i]])oArr[arr[i]]=0;oArr[arr[i]]++;}for(vari=0;i<brr.length;i++){if(!oBrr[brr[i]])oBrr[brr[i]]=0;oBrr[brr[i]]++;}varlMissingNumber=[];for(varkeyinoBrr){if(!oBrr.hasOwnProperty(key))continue;if(oBrr[key]!=oArr[key]){lMissingNumber.push(key);}}returnlMissingNumber;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Missing Numbers
You are viewing a single comment's thread. Return to all comments →
JS Solution