1
0
Fork 0
mirror of https://gitlab.com/mfocko/LeetCode.git synced 2024-09-19 17:56:55 +02:00
LeetCode/go/three-consecutive-odds.go
Matej Focko 1a015c14b4
go: add «1550. Three Consecutive Odds»
Signed-off-by: Matej Focko <me@mfocko.xyz>
2024-07-01 20:41:32 +02:00

11 lines
171 B
Go

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
}