1
0
Fork 0
mirror of https://gitlab.com/mfocko/LeetCode.git synced 2024-11-09 15:59:06 +01:00

go: add «1550. Three Consecutive Odds»

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2024-07-01 20:41:32 +02:00
parent 5bb1c156a4
commit 1a015c14b4
Signed by: mfocko
SSH key fingerprint: SHA256:5YXD7WbPuK60gxnG6DjAwJiS9+swoWj33/HFu8g8JVo

View file

@ -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
}