It's too strict to java solution


  • 0
    T

    I've stored String s & p to the class fields. and seems it will affect whether the solution pass or not.

    this will pass:

    n = s.length();     
    m = p.length();     
                        
    if (m == 0) {       
        return n == 0;  
    }                   
                        
    ss = s;             
    pp = p;     
    

    while following code will get TLE:

    ss = s;
    pp = p;
    n = s.length();
    m = p.length();
    
    if (m == 0) {
        return n == 0;
    }

Log in to reply
 

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