1# Runtime: 76 ms (Top 5.14%) | Memory: 13.9 MB (Top 11.51%)2class Solution:3def checkRecord(self, s: str) -> bool:4eligible = True56for i in range(0, len(s) - 2):7if s[i : i + 3] == "LLL":8eligible = False9absent = 010for i in range(len(s)):11if s[i] == "A":12absent += 11314if absent >= 2:15eligible = False1617return eligible