Skip to content

Latest commit

 

History

History

three-consecutive-odds

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

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