diff --git a/go/three-consecutive-odds.go b/go/three-consecutive-odds.go new file mode 100644 index 0000000..d424041 --- /dev/null +++ b/go/three-consecutive-odds.go @@ -0,0 +1,11 @@ +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 +}