class Solution:
def threeConsecutiveOdds(self, arr: List[int]) -> bool:
count=0
for i in arr:
if not(i&1):
count=0
else:
count += 1
if count==3:
return True
return False
LeetCode打卡84
最新推荐文章于 2022-11-12 12:02:37 发布