Since I always forget
// euclid.go
func gcd(a, b int) int {
if b == 0 {
return a
}
return gcd(b, a%b)
}
func lcm(a, b int) int {
return (a * b) / gcd(a, b)
}
Sun Feb 19 02:29:03 2017
Since I always forget
// euclid.go
func gcd(a, b int) int {
if b == 0 {
return a
}
return gcd(b, a%b)
}
func lcm(a, b int) int {
return (a * b) / gcd(a, b)
}