1line Python


  • 0
    class Solution(object):
        def checkRecord(self, s):
            """
            :type s: str
            :rtype: bool
            """
            return s.count("A") < 2 and not any(s[i] == s[i-1] == s[i-2] == "L" for i in range(2, len(s)))
    

Log in to reply
 

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