[抄题]: You are given a string representing an attendance record for a student. The record only contains the following three characters: 'A' : Absent. 'L' : Late. 'P' : Present. A student could be rewarded if his attendance record doesn't contain more…
551. Student Attendance Record I[easy] You are given a string representing an attendance record for a student. The record only contains the following three characters: 'A' : Absent. 'L' : Late. 'P' : Present. A student could be rewarded if his attend…
problem 551. Student Attendance Record I 题意: solution: class Solution { public: bool checkRecord(string s) { ; ; for(auto ch:s) { if('A'==ch) { ) return false;// cntL = ;// } else if('L' == ch) { ) return false;// } ;// } return true; } }; 理解题意很简单,重要…
▶ 一个学生的考勤状况是一个字符串,其中各字符的含义是:A 缺勤,L 迟到,P 正常.如果一个学生考勤状况中 A 不超过一个,且没有连续两个 L(L 可以有多个,但是不能连续),则称该学生达标(原文表述:A student could be rewarded if his attendance record doesn't contain more than one 'A' (absent) or more than two continuous 'L' (late). ) ▶ 551. 给定一…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 正则表达式 统计 日期 题目地址:https://leetcode.com/problems/student-attendance-record-i/#/description 题目描述 You are given a string representing an attendance record for a student. The record…
题目: You are given a string representing an attendance record for a student. The record only contains the following three characters: 'A' : Absent. 'L' : Late. 'P' : Present. A student could be rewarded if his attendance record doesn't contain more th…
You are given a string representing an attendance record for a student. The record only contains the following three characters: 'A' : Absent. 'L' : Late. 'P' : Present. A student could be rewarded if his attendance record doesn't contain more than o…
You are given a string representing an attendance record for a student. The record only contains the following three characters: 'A' : Absent. 'L' : Late. 'P' : Present. A student could be rewarded if his attendance record doesn't contain more than o…
给定一个字符串来代表一个学生的出勤纪录,这个纪录仅包含以下三个字符:    'A' : Absent,缺勤    'L' : Late,迟到    'P' : Present,到场如果一个学生的出勤纪录中不超过一个'A'(缺勤)并且不超过两个连续的'L'(迟到),那么这个学生会被奖赏.你需要根据这个学生的出勤纪录判断他是否会被奖赏.示例 1:输入: "PPALLP"输出: True 示例 2:输入: "PPALLL"输出: False详见:https://leetc…
static int wing=[]() { std::ios::sync_with_stdio(false); cin.tie(NULL); ; }(); class Solution { public: bool checkRecord(string s) { ; int len=s.length(); ;i<len;i++) { if(s[i]=='A') countA++; if(s[i]=='L') { <len&&s[i+]==]=='L') return fals…