121b. Find greatest common divisor using Euclid's recursion algorithm. The function can accept variable number of arguments.
Invoke function using at least 1 argument.
Nth arg (number) ... The number to find gcd. note that arg = 0 are not acceptable
Just 36b for 2 arguments! thanks to @Prinzhorn and @tsaniel.
function g(a,b){return b?g(b,a%b):a}
Note: rollback de6a6a
-> 932264
since its much longer and hard to debug.
Changing the places also works
function g(a,b){return b?g(b,a%b):a}