Skip to content

Commit 99b29a5

Browse files
authored
Create Solution2.cpp
1 parent 95e5e24 commit 99b29a5

File tree

1 file changed

+11
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)