[InterviewBit] Greatest Common Divisor

Greatest Common Divisor

  • Time :
  • Space :
1
2
3
int Solution::gcd(int A, int B) {
return !B ? A : gcd(B, A % B);
}
Author: Song Hayoung
Link: https://songhayoung.github.io/2022/10/05/PS/interviewbit/greatest-common-divisor/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.