2980. Check if Bitwise OR Has Trailing Zeros ¶ Time: $O(n)$ Space: $O(1)$ C++JavaPython 1 2 3 4 5 6 7 8 9 10 11 12class Solution { public: bool hasTrailingZeros(vector<int>& nums) { int countEven = 0; for (const int num : nums) if (num % 2 == 0) ++countEven; return countEven >= 2; } }; 1 2 3 4 5 6 7 8 9 10 11class Solution { public boolean hasTrailingZeros(int[] nums) { int countEven = 0; for (final int num : nums) if (num % 2 == 0) ++countEven; return countEven >= 2; } } 1 2 3class Solution: def hasTrailingZeros(self, nums: list[int]) -> bool: return sum(num % 2 == 0 for num in nums) >= 2