1550. Three Consecutive Odds

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1550

class Solution:
    def threeConsecutiveOdds(self, arr: List[int]) -> bool:
        for i in range(len(arr) - 2):
            if arr[i] % 2 + arr[i + 1] % 2 + arr[i + 2] % 2 == 3:
                return True
        return False