Skip to content

Commit d95f16b

Browse files
authored
Create 1550. Three Consecutive Odds
1 parent 6948877 commit d95f16b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

1550. Three Consecutive Odds

Lines changed: 10 additions & 0 deletions
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)