Intuitive Javascript Solution


  • 0
    D
    var checkRecord = function(s) {
        // check if there are more than 2 As and 3 continuous Ls
        return !/^.*(A.*A|L{3,}).*$/.test(s);
    };
    

Log in to reply
 

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