class Solution(object):
def checkRecord(self, s):
"""
:type s: str
:rtype: bool
"""
a_count = 0
l_count = 0
l_count_flag = False
for c in s:
if c == "A":
a_count += 1
if c == "L":
l_count += 1
if l_count >= 3:
l_count_flag = True
else:
l_count = 0
if a_count >= 2 or l_count_flag:
return False
else:
return True