log where each character describes one working day:
- 'P': on time;
- 'L': late;
- 'A': absent.
The attendance bonus is earned when both hold:
- there are fewer than two absences ('A') over the whole period;
- there are never three or more lates ('L') on consecutive days.
Return True if the employee earns the bonus and False otherwise.log='PLPALLP' → True
One absence, and lates come at most two days in a row, so the bonus is earned.
log='APPPPA' → False
Two absences are already too many.
log='PLLLP' → False
Three lates in a row.
log.length ≤ 1000log is 'A', 'L' or 'P'log='PLPALLP'
True
Run checks the first 3 tests in your browser. Submit checks all 184 tests on the server, hidden ones included.