1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 11:21:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

批量更新数据

This commit is contained in:
2025-01-09 20:29:41 +08:00
parent 04ecea043d
commit 48cdd06c2b
5053 changed files with 156164 additions and 135322 deletions

View File

@@ -0,0 +1,33 @@
<p>在一个由 <code>'L'</code> , <code>'R'</code><code>'X'</code> 三个字符组成的字符串(例如<code>"RXXLRXRXL"</code>)中进行移动操作。一次移动操作指用一个&nbsp;<code>"LX"</code>&nbsp;替换一个&nbsp;<code>"XL"</code>,或者用一个&nbsp;<code>"XR"</code>&nbsp;替换一个&nbsp;<code>"RX"</code>。现给定起始字符串&nbsp;<code>start</code>&nbsp;和结束字符串&nbsp;<code>result</code>,请编写代码,当且仅当存在一系列移动操作使得&nbsp;<code>start</code>&nbsp;可以转换成&nbsp;<code>result</code>&nbsp;时, 返回&nbsp;<code>True</code></p>
<p>&nbsp;</p>
<p><strong class="example">示例 1</strong></p>
<pre>
<strong>输入:</strong>start = "RXXLRXRXL", result = "XRLXXRRLX"
<strong>输出:</strong>true
<strong>解释:</strong>通过以下步骤我们可以将 start 转化为 result
RXXLRXRXL -&gt;
XRXLRXRXL -&gt;
XRLXRXRXL -&gt;
XRLXXRRXL -&gt;
XRLXXRRLX
</pre>
<p><strong class="example">示例 2</strong></p>
<pre>
<strong>输入:</strong>start = "X", result = "L"
<strong>输出:</strong>false
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= start.length&nbsp;&lt;= 10<sup>4</sup></code></li>
<li><code>start.length == result.length</code></li>
<li><code>start</code>&nbsp;<code>result</code>&nbsp;都只包含&nbsp;<code>'L'</code>, <code>'R'</code>&nbsp;&nbsp;<code>'X'</code></li>
</ul>