Sha256: 9e05e39b452ad63067455d5c97896b88d693e72a789ea0e5e6bd195a1541fa90
Contents?: true
Size: 217 Bytes
Versions: 14
Compression:
Stored size: 217 Bytes
Contents
#!/usr/bin/env ruby # GCD. We assume positive numbers def gcd(a, b) # Make: a <= b if a > b a, b = [b, a] end return nil if a <= 0 if a == 1 or b-a == 0 return a end gcd(b-a, a) end gcd(3,5)
Version data entries
14 entries across 14 versions & 1 rubygems