1550. Three Consecutive Odds

Photo by Tony Hand on Unsplash

1550. Three Consecutive Odds

class Solution:
    def threeConsecutiveOdds(self, arr: List[int]) -> bool:
        count = 0

        for e in arr:
            if e % 2:
                count += 1
            else:
                count = 0

            if count > 2:
                return True

        return count > 2