您得到一个代表学生的出席记录的字符串s,每个字符表示学生是否不在,迟到或当天出席.记录只包含以下三个字符: - 'A':不在. - 'L':迟到. - 'P':现场. 学生符合以下两个标准时符合出席奖项: - 学生严格缺席 ('A') 总共不到2天. - 学生从未连续3天或更长时间迟到 ('L'). 返回真假如果学生符合出席奖项的条件.
You can solve this problem by iterating over the attendance record of the student and keeping count of the number of absent and late days. You can use two variables to keep track of the current consecutive count of late days and the maximum consecutive count of late days so far. If you encounter an 'A', reset the consecutive count of late days to zero. At the end, check if the number of absent days is less than two and the maximum consecutive count of late days is less than three. If both conditions are true, return True; otherwise, return False. Here's an implementation in Python:

```
def check_attendance(s: str) -> bool:
    absent_count = 0
    max_consecutive_late_count = 0
    consecutive_late_count = 0
    
    for c in s:
        if c == 'A':
            absent_count += 1
            consecutive_late_count = 0
        elif c == 'L':
            consecutive_late_count += 1
            max_consecutive_late_count = max(max_consecutive_late_count, consecutive_late_count)
        else:
            consecutive_late_count = 0
    
    return absent_count < 2 and max_consecutive_late_count < 3
```

You can call this function with the attendance record string as input and it will return True if the student is eligible for an award and False otherwise. For example:

```
>>> check_attendance("PPALLP")
True

>>> check_attendance("PPALLL")
False
```