Beats around 70% ... JAVA Solutions


  • 0
    R
        public boolean checkRecord(String s) {
            if(s.contains("LLL")) {
                 return false;
            }
            if(s.indexOf("A") != -1 && s.indexOf("A") < s.lastIndexOf("A")) {
                return false;
            }
            return true;
        }
    

Log in to reply
 

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