DEV Community 👩‍💻👨‍💻

Discussion on: Daily Challenge #130 - GCD Sum

Collapse
_bkeren profile image
'' • Edited on

JavaScript ES6

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