python 1-line beats 94%


  • 0
    G

    use count() method to check whether s contains these conditions,so this is my code:

    class Solution(object):
        def checkRecord(self, s):
            return s.count('A')<2 and s.count('LLL')==0
    

Log in to reply
 

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