1
0
Fork 0
mirror of https://gitlab.com/mfocko/LeetCode.git synced 2024-11-14 09:59:41 +01:00
LeetCode/go/three-consecutive-odds.go

12 lines
171 B
Go
Raw Normal View History

package main
func threeConsecutiveOdds(arr []int) bool {
for i := 0; i+2 < len(arr); i++ {
if arr[i]&arr[i+1]&arr[i+2]&1 != 0 {
return true
}
}
return false
}