Three Consecutive Odds Solutions in C++Number 1550Difficulty EasyAcceptance 68.0%Link LeetCodeOther languages —SolutionsC++ solution by haoel/leetcode// Source : https://leetcode.com/problems/three-consecutive-odds/// Author : Hao Chen// Date : 2020-10-03 class Solution {public: bool threeConsecutiveOdds(vector<int>& arr) { int cnt = 0; for (auto n : arr) { if ( n % 2 ) cnt++; else cnt = 0; if (cnt >=3) return true; } return false; }};// Source : https://leetcode.com/problems/three-consecutive-odds/ // Author : Hao Chen // Date : 2020-10-03 class Solution { public: bool threeConsecutiveOdds(vector<int>& arr) { int cnt = 0; for (auto n : arr) { if ( n % 2 ) cnt++; else cnt = 0; if (cnt >=3) return true; } return false; } };