class Solution:
def checkRecord(self, s: str) -> bool:
absents = lates = 0
for i, c in enumerate(s):
if c == "A":
absents += 1
if absents >= 2:
return False
if c == "L":
lates += 1
if lates >= 3:
return False
else:
lates = 0
return True
相关文章
- 11-09掌握 Python 网络爬虫技术:从基础入门到高级实践(附带爬虫案例)
- 11-09爬虫策略规避:Python爬虫的浏览器自动化
- 11-09Python | Leetcode Python题解之第551题学生出勤记录I-题解:
- 11-09Python的函数
- 11-09软件测试基础十五(python 面向对象)
- 11-09【python】Flask
- 11-09【刷题17】最小栈、栈的压入弹出、逆波兰表达式-二、栈的压入弹出
- 11-09Python | Leetcode Python题解之第542题01矩阵-题解:
- 11-09WorkFlow源码剖析——Communicator之TCPServer(下)
- 11-09Python 基础笔记之生成器generator