We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
You are given a string representing an attendance record for a student. The record only contains the following three characters:
A student could be rewarded if his attendance record doesn't contain more than one 'A' (absent) or more than two continuous 'L' (late).
You need to return whether the student could be rewarded according to his attendance record.
Example 1:
Input: "PPALLP" Output: True
Example 2:
Input: "PPALLL" Output: False
class Solution { public boolean checkRecord(String s) { int count = 0; for(int i = 0; i < s.length() && count < 2; i++){ if(s.charAt(i) == 'A') count++; } return count < 2 && s.indexOf("LLL") < 0; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Student Attendance Record I
You are given a string representing an attendance record for a student. The record only contains the following three characters:
A student could be rewarded if his attendance record doesn't contain more than one 'A' (absent) or more than two continuous 'L' (late).
You need to return whether the student could be rewarded according to his attendance record.
Example 1:
Example 2:
The text was updated successfully, but these errors were encountered: