What does Timeout mean?


  • 0
    D

    My solution below got timeout. What does this mean?Thanks

    bool isMatch(const char *s, const char *p) {
        if (*p=='\0')
        return (*s=='\0');
        
        while(*s!='\0'&&p!='\0')
        {
            if (*p==*s||*p=='.')
            {
                if (*(p+1)=='*')
                {
    
                    while(*s==*(s+1))
                    s++;
                   
                    p=p+2;
                }
                else
                {
                    p++;
                    s++;
                }
            }
            else //*p!=*s
            {
                if (*(p+1)=='*')
                {
                    p=p+2;
                }
                else
                return false;
            }
        }
        while (*p=='*'){p++;}
        if(*p=='\0')
        return true;
        else
        return false;
    }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.