Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Leetcode-Easy/551. Student Attendance Record I/solution.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class Solution {
public:
bool checkRecord(string s) {
int ca = 0;
string cl = "LLL";
int cli = 0;
int find = s.find(cl);
for(int i=0; i<s.size(); i++) {
if(s[i] == 'A')
ca++;
if(find != string::npos)
cli = 1;
}

if(ca<2 && cli==0) {
return true;
}else
return false;
}
};