Files
2026-06-08 01:56:36 -04:00

11 lines
175 B
Go

package algo
// GCD gives the greatest common factor of two numbers
// EuclideanGCD O(log(n))
func GCD(a int, b int) int {
if b == 0 {
return a
}
return GCD(b, a%b)
}