simple C solution,4 lines,3ms


  • 0
    W
    bool checkRecord(char* s) {
        char *stmp=strchr(s,'A');
        if(stmp && strchr(stmp+1,'A')) return false;
        else if(strstr(s,"LLL")) return false;
        else return true;
    }
    

Log in to reply
 

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