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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy