551. Student Attendance Record I
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的更多相关文章
- 551. Student Attendance Record I【easy】
551. Student Attendance Record I[easy] You are given a string representing an attendance record for ...
- 【leetcode_easy】551. Student Attendance Record I
problem 551. Student Attendance Record I 题意: solution: class Solution { public: bool checkRecord(str ...
- 551. Student Attendance Record I 从字符串判断学生考勤
[抄题]: You are given a string representing an attendance record for a student. The record only contai ...
- 551. Student Attendance Record I + Student Attendance Record II
▶ 一个学生的考勤状况是一个字符串,其中各字符的含义是:A 缺勤,L 迟到,P 正常.如果一个学生考勤状况中 A 不超过一个,且没有连续两个 L(L 可以有多个,但是不能连续),则称该学生达标(原文表 ...
- [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 ...
- LeetCode 551. Student Attendance Record I (C++)
题目: You are given a string representing an attendance record for a student. The record only contains ...
- LeetCode 551. Student Attendance Record I (学生出勤纪录 I)
You are given a string representing an attendance record for a student. The record only contains the ...
- 【LeetCode】551. Student Attendance Record I 解题报告(Java & Python)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 正则表达式 统计 日期 题目地址:https://l ...
- 551 Student Attendance Record I 学生出勤纪录 I
给定一个字符串来代表一个学生的出勤纪录,这个纪录仅包含以下三个字符: 'A' : Absent,缺勤 'L' : Late,迟到 'P' : Present,到场如果一个学生的出勤纪 ...
随机推荐
- 42. linux下数据库服务启动
进到bin目录运行 emctl start dbconsole oracle@suse92:~> sqlplus /nolog SQL*Plus: Release 9.2.0.4.0 - Pro ...
- 使用spring注解——定义bean和自动注入
对于java bean的定义和依赖配置,使用xml文件真心是不方便. 今天学习如何用注解,解决bean的定义和注入. 常用注解: 1.自动注入:@Resources,@Autowired 2.Bean ...
- Android手机与服务器(案例一) webservice
1.服务端 建立webservice,增加方法gettime和sum. 测试正常8080端口,关闭防火墙. Start启动服务,并且OpenBrowser,XE6真是方便啊 http://localh ...
- configparser 文件的生成和读写
# configparser 生成 import configparser config = configparser.ConfigParser() config[DEFUALT] = {'Serve ...
- AS3 - 数组元素乱序方法以及效率比较
http://www.hangge.com/blog/cache/detail_453.html
- import tensorflow 报错,CentOS 升级 glibc
问题描述: ]: import tensorflow as tf ImportError: /lib64/libc.so.: version `GLIBC_2.' not found (require ...
- (转载)session token机制
http://blog.chinaunix.net/uid-26642709-id-3061264.html 使用session token时,必须用struts2表标签库,不能用html 通过ses ...
- scala-- 内建控制结构
内建控制结构 scala 内建的控制结构很少,只有 if while for try match 和函数调用 几种. 因为scala 从语法层面支持函数字面量.几乎所有的scala控制结构都会产生 ...
- conductor Workflow Metrics
Server Metrics conductor使用spectator收集指标.https://github.com/Netflix/spectator 名称 目的 标签 workflow_serve ...
- chrome 调试参数(鼠标事件)
1.监听鼠标事件: monitorEvents(document.body, 'mouse') 取消监听: unmonitorEvents(document.body) 原文链接: https://b ...