From 1a015c14b4606b1cc23e6ab3235737f241207ed3 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Mon, 1 Jul 2024 20:41:32 +0200 Subject: [PATCH] =?UTF-8?q?go:=20add=20=C2=AB1550.=20Three=20Consecutive?= =?UTF-8?q?=20Odds=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matej Focko --- go/three-consecutive-odds.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 go/three-consecutive-odds.go 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 +}