Given an integer array arr, return true if there are 333 consecutive odd numbers in the array, and false otherwise.
arr
true
false
Constraints:
1≤1 \leq1≤ arr.length ≤1000\leq 1000≤1000
arr.length
1≤1 \leq1≤ arr[i] ≤1000\leq 1000≤1000
arr[i]
Now, let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Three Consecutive Odds
For the input arr = [7], what should the function return?
arr = [7]
true because a single odd number is enough
false because there are not (3) consecutive odd numbers
true because (7) is odd and the array has length (1)
false because the array contains no even numbers
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Implement your solution in the following coding playground.