Class Solution

java.lang.Object
g1501_1600.s1550_three_consecutive_odds.Solution

public class Solution extends Object
1550 - Three Consecutive Odds.<p>Easy</p> <p>Given an integer array <code>arr</code>, return <code>true</code> if there are three consecutive odd numbers in the array. Otherwise, return <code>false</code>.</p> <p><strong>Example 1:</strong></p> <p><strong>Input:</strong> arr = [2,6,4,1]</p> <p><strong>Output:</strong> false</p> <p><strong>Explanation:</strong> There are no three consecutive odds.</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> arr = [1,2,34,3,4,5,7,23,12]</p> <p><strong>Output:</strong> true</p> <p><strong>Explanation:</strong> [5,7,23] are three consecutive odds.</p> <p><strong>Constraints:</strong></p> <ul> <li><code>1 <= arr.length <= 1000</code></li> <li><code>1 <= arr[i] <= 1000</code></li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • threeConsecutiveOdds

      public boolean threeConsecutiveOdds(int[] arr)