Skip to content

Commit 1e50cb1

Browse files
committed
2980. Check if Bitwise OR Has Trailing Zeros
1 parent 7b62dc7 commit 1e50cb1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Solution {
2+
3+
// Solution by Sergey Leschev
4+
// 2980. Check if Bitwise OR Has Trailing Zeros
5+
6+
func hasTrailingZeros(_ nums: [Int]) -> Bool {
7+
var evenCount = 0
8+
9+
for n in nums {
10+
evenCount += (n % 2 == 0) ? 1 : 0
11+
}
12+
13+
return evenCount >= 2
14+
}
15+
}

0 commit comments

Comments
 (0)