mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 03:11:42 +08:00
批量更新数据
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
<p>You are given a <strong>0-indexed</strong> string <code>s</code> that has lowercase English letters in its <strong>even</strong> indices and digits in its <strong>odd</strong> indices.</p>
|
||||
|
||||
<p>There is a function <code>shift(c, x)</code>, where <code>c</code> is a character and <code>x</code> is a digit, that returns the <code>x<sup>th</sup></code> character after <code>c</code>.</p>
|
||||
<p>You must perform an operation <code>shift(c, x)</code>, where <code>c</code> is a character and <code>x</code> is a digit, that returns the <code>x<sup>th</sup></code> character after <code>c</code>.</p>
|
||||
|
||||
<ul>
|
||||
<li>For example, <code>shift('a', 5) = 'f'</code> and <code>shift('x', 0) = 'x'</code>.</li>
|
||||
</ul>
|
||||
|
||||
<p>For every <strong>odd</strong> index <code>i</code>, you want to replace the digit <code>s[i]</code> with <code>shift(s[i-1], s[i])</code>.</p>
|
||||
<p>For every <strong>odd</strong> index <code>i</code>, you want to replace the digit <code>s[i]</code> with the result of the <code>shift(s[i-1], s[i])</code> operation.</p>
|
||||
|
||||
<p>Return <code>s</code><em> after replacing all digits. It is <strong>guaranteed</strong> that </em><code>shift(s[i-1], s[i])</code><em> will never exceed </em><code>'z'</code>.</p>
|
||||
<p>Return <code>s</code><em> </em>after replacing all digits. It is <strong>guaranteed</strong> that<em> </em><code>shift(s[i-1], s[i])</code><em> </em>will never exceed<em> </em><code>'z'</code>.</p>
|
||||
|
||||
<p><strong>Note</strong> that <code>shift(c, x)</code> is <strong>not</strong> a preloaded function, but an operation <em>to be implemented</em> as part of the solution.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
|
Reference in New Issue
Block a user