Simplest 1 line Python Solution 72ms


  • -1
    K

    Count how many 'A' in the string, check whether there is three consecutive 'L's in the string.

        def checkRecord(self, s):
            """
            :type s: str
            :rtype: bool
            """
            return collections.Counter(s)['A'] <= 1 and s.find('LLL') < 0
    

Log in to reply
 

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