OneCompiler

b/w two set hackerRank problem

185

const a= [2,6];
const b =[24,36];
let a1 = Math.max(...a);
let b1 = Math.max(...b);
let c=0
for(i=a1;i<b1;i++)
{
if(a.every(v => i%v ===0) && b.every(v =>v%i ==0))
c++;

}
console.log(c)