/**
 * Calculates GCD of two numbers
 * @param  {Number} a First number
 * @param  {Number} b Second number
 * @return {Number}   HCF or GCD of two numbers
 */
const gcd = (a, b) => {
  if (a === 0 || b === 0) {
    return 0;
  }

  if (a === b) {
    return a;
  }

  if (a > b) {
    return gcd(a - b, b);
  }

  return gcd(a, b - a);
};

module.exports = gcd;

@@ -155,33 +155,192 @@
 s%0A *
-/%0Aconst gcd = (a, b) =%3E %7B
+%0A * References: https://math.stackexchange.com/questions/927050/can-we-find-the-gcd-of-a-positive-and-negative-number%0A */%0Aconst gcd = (a, b) =%3E %7B%0A  a = Math.abs(a);%0A  b = Math.abs(b);%0A
 %0A  i

Handle negative numbers