mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 19:53:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			819 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			819 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>给你一个整数数组 <code>arr</code>,请你判断数组中是否存在连续三个元素都是奇数的情况:如果存在,请返回 <code>true</code> ;否则,返回 <code>false</code> 。</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<pre><strong>输入:</strong>arr = [2,6,4,1]
 | 
						||
<strong>输出:</strong>false
 | 
						||
<strong>解释:</strong>不存在连续三个元素都是奇数的情况。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p><strong>示例 2:</strong></p>
 | 
						||
 | 
						||
<pre><strong>输入:</strong>arr = [1,2,34,3,4,5,7,23,12]
 | 
						||
<strong>输出:</strong>true
 | 
						||
<strong>解释:</strong>存在连续三个元素都是奇数的情况,即 [5,7,23] 。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>1 <= arr.length <= 1000</code></li>
 | 
						||
	<li><code>1 <= arr[i] <= 1000</code></li>
 | 
						||
</ul>
 |