FunctionRacerProblemsRace

Student Attendance Record

BeginnerStringsPython, JavaScript, TypeScript, Java, C++

Each character of s is a day: A absent, L late, P present. The student can get an award if both are true:

Return True if the student gets the award, otherwise False.

Example 1

s "PPALLP"
returns true

One absence, and only two lates in a row.

Example 2

s "PPALLL"
returns false

Three lates in a row.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Strings problems