2025-08-22 14:02:28 +0000 UTC

Check if Bitwise OR Has Trailing Zeros

Code

class Solution:
    def hasTrailingZeros(self, nums: List[int]) -> bool:
        cnt = 0
        for num in nums:
            if num & 1 == 0:
                cnt += 1
                if cnt == 2:
                    return True
        return False