classSolution {publicbooleancheckRecord(String s) { int aCount =0;for (char c :s.toCharArray()) {if (c =='A') { aCount++;if (aCount >=2) {returnfalse; } } }return!s.contains("LLL"); }}/*The student was absent ('A') for strictly fewer than 2 days total.The student was never late ('L') for 3 or more consecutive days.A count < 2L no 3 consecutive days*/