CPP easy and quite Simple


#1

int Solution::gcd(int A, int B) {
int i = A<B ? A:B;
for(;i>0;i–) {
if(A%i==0 && B%i==0) return i;
}
return A>B?A:B;
}