diff --git a/gcd.hhs b/gcd.hhs new file mode 100644 index 0000000..44db42e --- /dev/null +++ b/gcd.hhs @@ -0,0 +1,12 @@ +/** + * @author Yu Li + * @param a, b - integers + * @returns - gcd of a, b + * find the greatest common divisor of a, b + */ +function gcd(a, b) { + if (b == 0) { + return a; + } + return gcd(b, a % b); +} \ No newline at end of file