static int wing=[]()
{
std::ios::sync_with_stdio(false);
cin.tie(NULL);
return ;
}(); class Solution
{
public:
bool checkRecord(string s)
{
int countA=;
int len=s.length();
for(int i=;i<len;i++)
{
if(s[i]=='A')
countA++;
if(s[i]=='L')
{
if(i+<len&&s[i+]=='L'&&s[i+]=='L')
return false;
}
}
return countA>? false:true;
}
};

简单,问题不大

551. Student Attendance Record I的更多相关文章

  1. 551. Student Attendance Record I【easy】

    551. Student Attendance Record I[easy] You are given a string representing an attendance record for ...

  2. 【leetcode_easy】551. Student Attendance Record I

    problem 551. Student Attendance Record I 题意: solution: class Solution { public: bool checkRecord(str ...

  3. 551. Student Attendance Record I 从字符串判断学生考勤

    [抄题]: You are given a string representing an attendance record for a student. The record only contai ...

  4. 551. Student Attendance Record I + Student Attendance Record II

    ▶ 一个学生的考勤状况是一个字符串,其中各字符的含义是:A 缺勤,L 迟到,P 正常.如果一个学生考勤状况中 A 不超过一个,且没有连续两个 L(L 可以有多个,但是不能连续),则称该学生达标(原文表 ...

  5. [LeetCode&Python] Problem 551. Student Attendance Record I

    You are given a string representing an attendance record for a student. The record only contains the ...

  6. LeetCode 551. Student Attendance Record I (C++)

    题目: You are given a string representing an attendance record for a student. The record only contains ...

  7. LeetCode 551. Student Attendance Record I (学生出勤纪录 I)

    You are given a string representing an attendance record for a student. The record only contains the ...

  8. 【LeetCode】551. Student Attendance Record I 解题报告(Java & Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 正则表达式 统计 日期 题目地址:https://l ...

  9. 551 Student Attendance Record I 学生出勤纪录 I

    给定一个字符串来代表一个学生的出勤纪录,这个纪录仅包含以下三个字符:    'A' : Absent,缺勤    'L' : Late,迟到    'P' : Present,到场如果一个学生的出勤纪 ...

随机推荐

  1. Redis 通用操作1

    01, 设置值 => set key value  01.1, 设置值并添加有效期 => set key value ex 秒数 或者 set key value px 毫秒数 01.2, ...

  2. net 编译报错:编辑器或项目正在尝试签出在内存中修改的文件,这将导致保存该文件

    1,报错提示: 编辑器或项目正在尝试签出在内存中修改的文件,这将导致保存该文件. 在生成过程中保存文件是危险的,这可能会在将来导致不正确的生成输出. 是否仍然继续签出? 2,原因:licenses.l ...

  3. XE Styles不见了

    C:\Users\Public\Documents\Embarcadero\Studio\15.0\Styles 我移动到D盘了 D:\Users\Public\Documents\Embarcade ...

  4. As3.0中的位图(Bitmap/BitmapData)编程

    https://blog.csdn.net/wtuetnsrmh/article/details/12577929

  5. C++Primer笔记-----day08

    ==========================================================================day08===================== ...

  6. Erlang/OTP:基于Behaviour的回调函数

    原始链接:https://blog.zhustec.me/posts/erlang-otp-1-callback-based-on-behaviour OTP 是什么 OTP 的全称是开源电信平台 ( ...

  7. 搭建Turbine时,报错误:Property or field 'default' cannot be found on object of type 'com.netflix.appinfo.InstanceInfo'

    Spring Boot + Eureka Server + Hystrix with Turbine: empty turbine.stream 配置的时候遇到了问题: Property or fie ...

  8. How to Pronounce the Word THEM

    How to Pronounce the Word THEM Share Tweet Share Tagged With: THEM Reduction Study the THEM reductio ...

  9. delphi常用函数和方法

     uses ShellApi, ActiveX, ComObj, ShlObj; function HasText(Text: string; const Values: array of strin ...

  10. System.Data.SqlClient.SqlError: 尚未备份数据库的日志尾部

    SQL还原时出现下面的错误,System.Data.SqlClient.SqlError: 尚未备份数据库 "***" 的日志尾部.如果该日志包含您不希望丢失的工作,请使用 BAC ...