Tap here to switch tabs
Problem
Submissions

Problem: Student Attendance Record I

med
30 min
Try to solve the Student Attendance Record I problem.

Statement

You are given a string s representing an attendance record for a student, where each character indicates their attendance on that day:

  • 'A': Absent.

  • 'L': Late.

  • 'P': Present.

The student is eligible for an attendance award if they satisfy both of the following conditions:

  • The student was absent ('A') for strictly fewer than 22 days in total.

  • The student was never late ('L') for 33 or more consecutive days.

Return true if the student is eligible for the attendance award, or false otherwise.

Constraints:

  • 1≤1 \leq s.length ≤1000\leq 1000

  • s[i] is either 'A', 'L', or 'P'.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Student Attendance Record I

med
30 min
Try to solve the Student Attendance Record I problem.

Statement

You are given a string s representing an attendance record for a student, where each character indicates their attendance on that day:

  • 'A': Absent.

  • 'L': Late.

  • 'P': Present.

The student is eligible for an attendance award if they satisfy both of the following conditions:

  • The student was absent ('A') for strictly fewer than 22 days in total.

  • The student was never late ('L') for 33 or more consecutive days.

Return true if the student is eligible for the attendance award, or false otherwise.

Constraints:

  • 1≤1 \leq s.length ≤1000\leq 1000

  • s[i] is either 'A', 'L', or 'P'.