551. Student Attendance Record I
来源:互联网 发布:阿里云logo矢量图下载 编辑:程序博客网 时间:2024/06/05 22:57
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 one 'A' (absent) or more than two continuous 'L' (late).
You need to return whether the student could be rewarded according to his attendance record.
code:
class Solution(object):
def checkRecord(self, s):
"""
:type s: str
:rtype: bool
"""
return s.count("A")<=1 and s.count("LLL")<1
0 0
- 551. Student Attendance Record I
- 551. Student Attendance Record I
- 551. Student Attendance Record I
- 551. Student Attendance Record I
- 551. Student Attendance Record I
- 551. Student Attendance Record I
- 551. Student Attendance Record I
- 551. Student Attendance Record I
- 551. Student Attendance Record I
- 551. Student Attendance Record I
- 551. Student Attendance Record I
- 551. Student Attendance Record I
- Student Attendance Record I
- Student Attendance Record I
- Student Attendance Record I
- LeetCode 551. Student Attendance Record I
- [LeetCode]551. Student Attendance Record I
- LeetCode 551. Student Attendance Record I
- 图片自适应父元素大小,并左右上下居中的css方法
- php中echo js中alert中文乱码问题的解决方法
- java.beans.Introspector
- Windows下 haoop下运行程序时出现错误:Hadoop HDFS Wrong FS: hdfs:/ expected file:///
- jsp 统计有几个2000年到2014年有几个闰年
- 551. Student Attendance Record I
- ZooKeeper 下载安装
- struts2标签库----数据标签详解
- Centos 6.5 Install SCP
- oracle 监控索引使用情况
- Android -- Wifi的forget()操作
- Selenium2.0之WebDriver学习总结(2)
- Python MySQLdb在Linux下的快速安装
- JSP数据交互(application、cookie)