最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

leetcode 1550 Three Consecutive Odds

2022-03-07 21:14 作者:您是打尖兒還是住店呢  | 我要投稿

Given an integer array?arr, return?true?if there are three consecutive odd numbers in the array. Otherwise, return?false.

?

Example 1:

Input: arr = [2,6,4,1]Output: falseExplanation: There are no three consecutive odds.

Example 2:

Input: arr = [1,2,34,3,4,5,7,23,12]Output: trueExplanation: [5,7,23] are three consecutive odds.

?

Constraints:

  • 1 <= arr.length <= 1000

  • 1 <= arr[i] <= 1000

就是循環(huán)一次,max記住一下連續(xù)最多的奇數(shù)的數(shù)量,然后大于等于3返回true;否則false;

Runtime:?0 ms, faster than?100.00%?of?Java?online submissions for?Three Consecutive Odds.

Memory Usage:?42.5 MB, less than?41.25%?of?Java?online submissions for?Three Consecutive Odds.


leetcode 1550 Three Consecutive Odds的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
新巴尔虎左旗| 安西县| 栾川县| 炉霍县| 绥滨县| 赤水市| 清涧县| 西平县| 扬州市| 呼玛县| 缙云县| 广宗县| 临汾市| 闽清县| 保定市| 平原县| 红原县| 右玉县| 同心县| 伊川县| 宜良县| 油尖旺区| 芜湖市| 曲阳县| 孟津县| 齐河县| 高台县| 定边县| 桐乡市| 岢岚县| 灵石县| 南开区| 长汀县| 繁昌县| 汶上县| 交城县| 泰安市| 曲阳县| 哈巴河县| 屯昌县| 牡丹江市|