What is wrong with this code? Getting a TLE error during execution

programming
Tags: #<Tag:0x00007f2428889f48>

#1
int gcd(int m, int n)
{
    if(m==0)
        return n;
    else if(n==0)
        return m;

    if(n>m)
    {
        return gcd(n,m);
    }

    if(m%n==0)
        return n;
    else
        return gcd(n, m%n);
}

int Solution::gcd(int m, int n)
{
    int res = gcd(m,n);
    return res;
}

This code runs just fine on my local machine.


#2

Just look at the function name and function on which you are working