Fetch the repository succeeded.
This action will force synchronization from 小墨/力扣题库(完整版), which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
<p>On an alphabet board, we start at position <code>(0, 0)</code>, corresponding to character <code>board[0][0]</code>.</p>
<p>Here, <code>board = ["abcde", "fghij", "klmno", "pqrst", "uvwxy", "z"]</code>, as shown in the diagram below.</p>
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/07/28/azboard.png" style="width: 250px; height: 317px;" /></p>
<p>We may make the following moves:</p>
<ul>
<li><code>'U'</code> moves our position up one row, if the position exists on the board;</li>
<li><code>'D'</code> moves our position down one row, if the position exists on the board;</li>
<li><code>'L'</code> moves our position left one column, if the position exists on the board;</li>
<li><code>'R'</code> moves our position right one column, if the position exists on the board;</li>
<li><code>'!'</code> adds the character <code>board[r][c]</code> at our current position <code>(r, c)</code> to the answer.</li>
</ul>
<p>(Here, the only positions that exist on the board are positions with letters on them.)</p>
<p>Return a sequence of moves that makes our answer equal to <code>target</code> in the minimum number of moves. You may return any path that does so.</p>
<p> </p>
<p><strong>Example 1:</strong></p>
<pre><strong>Input:</strong> target = "leet"
<strong>Output:</strong> "DDR!UURRR!!DDD!"
</pre><p><strong>Example 2:</strong></p>
<pre><strong>Input:</strong> target = "code"
<strong>Output:</strong> "RR!DDRR!UUL!R!"
</pre>
<p> </p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= target.length <= 100</code></li>
<li><code>target</code> consists only of English lowercase letters.</li>
</ul>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。