bumpsoo 2024-07-01 21:29:59 +09:00
commit 265fcfa6b1

View file

@ -0,0 +1,15 @@
#https://leetcode.com/problems/three-consecutive-odds
from typing import List
class Solution:
def threeConsecutiveOdds(self, arr: List[int]) -> bool:
cnt = 0
for v in arr:
if v % 2 == 0:
cnt = 0
continue
cnt += 1
if cnt >= 3:
break
return cnt >= 3