1
var canMeasureWater = function (jug1Capacity, jug2Capacity, targetCapacity) {
2
const gcd = (x, y) => (y === 0 ? x : gcd(y, x % y));
3

4
return (
5
jug1Capacity + jug2Capacity >= targetCapacity &&
6
targetCapacity % gcd(jug1Capacity, jug2Capacity) === 0
7
);
8
};

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0