loading...

re: Daily Challenge #130 - GCD Sum VIEW POST

FULL DISCUSSION
 

JavaScript ES6

const solve = (sum,gcd) => {
if(sum%gcd) return -1;
const constantSum = sum / gcd;
return [gcd,(constantSum-1) * gcd]
}

code of conduct - report abuse