Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 521 Bytes

File metadata and controls

22 lines (16 loc) · 521 Bytes

Three consecutive odds

Problem link

Solutions

Solution.py

# https://leetcode.com/problems/three-consecutive-odds/

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

Tags