Three Consecutive Odds
The task requires us to determine if there are three consecutive odd numbers in the given array.
|
|
Explanation
- The code iterates through the array up to the third last element, as we need to check three consecutive numbers.
- For each element, it checks if the current element and the next two elements are odd.
- If it finds three consecutive odd numbers, it returns True. If not, it will continue iterating through the array.
- If it does not find any three consecutive odd numbers in the entire array, it will return False.