Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

added gcd.hhs #28

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions gcd.hhs
Original file line number Diff line number Diff line change
@@ -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);
}