1550. Three Consecutive Odds Easy
1/**
2 * [1550] Three Consecutive Odds
3 *
4 * Given an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false.
5 *
6 * Example 1:
7 *
8 * Input: arr = [2,6,4,1]
9 * Output: false
10 * Explanation: There are no three consecutive odds.
11 *
12 * Example 2:
13 *
14 * Input: arr = [1,2,34,3,4,5,7,23,12]
15 * Output: true
16 * Explanation: [5,7,23] are three consecutive odds.
17 *
18 *
19 * Constraints:
20 *
21 * 1 <= arr.length <= 1000
22 * 1 <= arr[i] <= 1000
23 *
24 */
25pub struct Solution {}
26
27// problem: https://leetcode.com/problems/three-consecutive-odds/
28// discuss: https://leetcode.com/problems/three-consecutive-odds/discuss/?currentPage=1&orderBy=most_votes&query=
29
30// submission codes start here
31
32impl Solution {
33 pub fn three_consecutive_odds(arr: Vec<i32>) -> bool {
34 false
35 }
36}
37
38// submission codes end
39
40#[cfg(test)]
41mod tests {
42 use super::*;
43
44 #[test]
45 fn test_1550() {
46 }
47}
48
Back
© 2025 bowen.ge All Rights Reserved.