Skip to content

Commit c490ded

Browse files
authored
Create 1550. Three Consecutive Odds (#518)
2 parents 6948877 + d95f16b commit c490ded

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

1550. Three Consecutive Odds

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution {
2+
public:
3+
bool threeConsecutiveOdds(std::vector<int>& arr) {
4+
std::string binaryString;
5+
for (int num : arr) {
6+
binaryString += (num % 2) ? '1' : '0';
7+
}
8+
return binaryString.find("111") != std::string::npos;
9+
}
10+
};

0 commit comments

Comments
 (0)