478. Student Attendance Record
EasyString
The record uses A (absent), L (late) and P (present). Print YES if the student has fewer than 2 absences and was never late 3 days in a row, else NO.
Input format
One string
Output format
YES or NO
Example 1
Input
PPALLP
Output
YES
Example 2
Input
PPALLL
Output
NO
Constraints
1 ≤ |s| ≤ 1000
Read input from standard input and print the answer to standard output. Your code is judged against 4 test cases, most of them hidden.
Loading the MyLoginn IDE…