Skip to content

Commit 9e0b128

Browse files
authored
Update Solution.go
1 parent 9dfb068 commit 9e0b128

File tree

1 file changed

+6
-6
lines changed
  • solution/1500-1599/1550.Three Consecutive Odds

1 file changed

+6
-6
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
func threeConsecutiveOdds(arr []int) bool {
22
cnt := 0
3-
for _, v := range arr {
4-
if v%2 == 1 {
3+
for _, x := range arr {
4+
if x&1 == 1 {
55
cnt++
6+
if cnt == 3 {
7+
return true
8+
}
69
} else {
710
cnt = 0
811
}
9-
if cnt == 3 {
10-
return true
11-
}
1212
}
1313
return false
14-
}
14+
}

0 commit comments

Comments
 (0)