We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 975eeb7 commit dac8f31Copy full SHA for dac8f31
src/leetcode2018/StudentAttendanceRecordI.java
@@ -0,0 +1,18 @@
1
+package leetcode2018;
2
+
3
+public class StudentAttendanceRecordI {
4
+ public boolean checkRecord(String s) {
5
+ if(s.length() == 0) return true;
6
+ int i=0;
7
+ int j=0;
8
9
+ for(char c: s.toCharArray()){
10
+ if(c!='L') j=0;
11
+ if(c=='A') i++;
12
+ if(c=='L') j++;
13
+ if(j>2) return false;
14
+ }
15
+ if(i>1) return false;
16
+ return true;
17
18
+}
0 commit comments