commit 265fcfa6b155383d22ee5410b494496b6b30ede6 Author: bumpsoo Date: Mon Jul 1 21:29:59 2024 +0900 https://leetcode.com/problems/three-consecutive-odds diff --git a/easy/three_consecutive_odds.py b/easy/three_consecutive_odds.py new file mode 100644 index 0000000..f2acc86 --- /dev/null +++ b/easy/three_consecutive_odds.py @@ -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 +