Skip to content

Commit 95e5e24

Browse files
authored
Create Solution2.java
1 parent 9bd3798 commit 95e5e24

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution {
2+
public boolean threeConsecutiveOdds(int[] arr) {
3+
for (int i = 2, n = arr.length; i < n; ++i) {
4+
if ((arr[i - 2] & arr[i - 1] & arr[i] & 1) == 1) {
5+
return true;
6+
}
7+
}
8+
return false;
9+
}
10+
}

0 commit comments

Comments
 (0)