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.
//JS is the best.functionsolve(){varargument=Array.prototype.slice.call(arguments);vara=0,b=0;varalice=argument.splice(0,argument.length/2);varbob=argument.splice(0,argument.length);for(i=0;i<alice.length;i++){if(alice[i]>bob[i]){a++;}if(alice[i]<bob[i]){b++;}}return[a,b];}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Compare the Triplets
You are viewing a single comment's thread. Return to all comments →