1 line python easy understand solution


  • 1
    class Solution(object):
        def checkRecord(self, s):
            return s.count("A")<2 and reduce(max,map(len,re.split(r'A|P',s)))<3
                
            
    

Log in to reply
 

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