4 lines javascript solution


  • 0
    G

    var checkRecord = function(s) {
    if((s.lastIndexOf('A') - s.indexOf('A'))>0 || s.match("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.