mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
26 lines
669 B
HTML
26 lines
669 B
HTML
|
<p>从<strong>若干副扑克牌</strong>中随机抽 <code>5</code> 张牌,判断是不是一个顺子,即这5张牌是不是连续的。2~10为数字本身,A为1,J为11,Q为12,K为13,而大、小王为 0 ,可以看成任意数字。A 不能视为 14。</p>
|
|||
|
|
|||
|
<p> </p>
|
|||
|
|
|||
|
<p><strong>示例 1:</strong></p>
|
|||
|
|
|||
|
<pre>
|
|||
|
<strong>输入:</strong> [1,2,3,4,5]
|
|||
|
<strong>输出:</strong> True</pre>
|
|||
|
|
|||
|
<p> </p>
|
|||
|
|
|||
|
<p><strong>示例 2:</strong></p>
|
|||
|
|
|||
|
<pre>
|
|||
|
<strong>输入:</strong> [0,0,1,2,5]
|
|||
|
<strong>输出:</strong> True</pre>
|
|||
|
|
|||
|
<p> </p>
|
|||
|
|
|||
|
<p><strong>限制:</strong></p>
|
|||
|
|
|||
|
<p>数组长度为 5 </p>
|
|||
|
|
|||
|
<p>数组的数取值为 [0, 13] .</p>
|