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.
my simple javascript code, dont be overengineering
functiongetTotalX(a,b){// Write your code hereletcount=0for(leti=a[a.length-1];i<=b[0];i++){constisFactorB=b.every(v=>v%i===0)constisAFactor=a.every(v=>i%v===0)if(isFactorB&&isAFactor){count++}}returncount}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Between Two Sets
You are viewing a single comment's thread. Return to all comments →
my simple javascript code, dont be overengineering