Skip to content

Commit 5e0ab53

Browse files
committed
2980. Check if Bitwise OR Has Trailing Zeros
1 parent 5a6708a commit 5e0ab53

File tree

1 file changed

+14
-0
lines changed
  • Check if Bitwise OR Has Trailing Zeros

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package kata
2+
3+
func hasTrailingZeros(nums []int) bool {
4+
var count int
5+
for _, num := range nums {
6+
if num%2 == 0 {
7+
count++
8+
if count == 2 {
9+
break
10+
}
11+
}
12+
}
13+
return count == 2
14+
}

0 commit comments

Comments
 (0)