Easy 4 line cpp solution ,TC=O(log^( min(a,b) ) )


#1

int Solution::gcd(int A, int B) {
while(B>0)
{
int c=A%B;
A=B;
B=c;
}
return A;
}