mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-04 15:01:40 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<p>总计有 <code>n</code> 个环,环的颜色可以是红、绿、蓝中的一种。这些环分布穿在 10 根编号为 <code>0</code> 到 <code>9</code> 的杆上。</p>
|
||||
<p>总计有 <code>n</code> 个环,环的颜色可以是红、绿、蓝中的一种。这些环分别穿在 10 根编号为 <code>0</code> 到 <code>9</code> 的杆上。</p>
|
||||
|
||||
<p>给你一个长度为 <code>2n</code> 的字符串 <code>rings</code> ,表示这 <code>n</code> 个环在杆上的分布。<code>rings</code> 中每两个字符形成一个 <strong>颜色位置对</strong> ,用于描述每个环:</p>
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2021/11/23/ex1final.png" style="width: 258px; height: 130px;">
|
||||
<pre><strong>输入:</strong>rings = "B0B6G0R6R0R6G9"
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2021/11/23/ex1final.png" style="width: 258px; height: 130px;" />
|
||||
<pre>
|
||||
<strong>输入:</strong>rings = "B0B6G0R6R0R6G9"
|
||||
<strong>输出:</strong>1
|
||||
<strong>解释:</strong>
|
||||
- 编号 0 的杆上有 3 个环,集齐全部颜色:红、绿、蓝。
|
||||
@@ -25,8 +26,9 @@
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2021/11/23/ex2final.png" style="width: 266px; height: 130px;">
|
||||
<pre><strong>输入:</strong>rings = "B0R0G0R9R0B0G0"
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2021/11/23/ex2final.png" style="width: 266px; height: 130px;" />
|
||||
<pre>
|
||||
<strong>输入:</strong>rings = "B0R0G0R9R0B0G0"
|
||||
<strong>输出:</strong>1
|
||||
<strong>解释:</strong>
|
||||
- 编号 0 的杆上有 6 个环,集齐全部颜色:红、绿、蓝。
|
||||
@@ -36,7 +38,8 @@
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>rings = "G4"
|
||||
<pre>
|
||||
<strong>输入:</strong>rings = "G4"
|
||||
<strong>输出:</strong>0
|
||||
<strong>解释:</strong>
|
||||
只给了一个环,因此,不存在集齐全部三种颜色环的杆。
|
||||
|
Reference in New Issue
Block a user