30:00
Given an integer array arr, return true if it contains three odd numbers in a row (at three consecutive positions). Otherwise return false.
1≤arr.length≤10001 \leq \text{arr.length} \leq 10001≤arr.length≤1000
1≤arr[i]≤10001 \leq \text{arr}[i] \leq 10001≤arr[i]≤1000
Run code to see results.
Keep one counter: the length of the run of odd numbers ending at the current position. Three in a row means the counter reaches 3.
arr: odd numbers marked with a dot, current run bracketed
i
streak meter (needs 3)
streak = 0
Return true if an integer array has three odd numbers at adjacent positions, and false otherwise.