Leetcode 1293 Solution
This article provides solution to leetcode question 1293 (three-consecutive-odds)
Access this page by simply typing in "lcs 1293" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/three-consecutive-odds
Solution
class Solution:
def threeConsecutiveOdds(self, arr: List[int]) -> bool:
odd_cnt = 0
for v in arr:
if v % 2 == 1:
odd_cnt += 1
else:
odd_cnt = 0
if odd_cnt == 3:
return True
return False