1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/解码字母到整数映射 [decrypt-string-from-alphabet-to-integer-mapping].html
2022-03-29 12:43:11 +08:00

38 lines
1.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个字符串&nbsp;<code>s</code>,它由数字(<code>'0'</code> - <code>'9'</code>)和&nbsp;<code>'#'</code>&nbsp;组成。我们希望按下述规则将&nbsp;<code>s</code>&nbsp;映射为一些小写英文字符:</p>
<ul>
<li>字符(<code>'a'</code> - <code>'i'</code>)分别用(<code>'1'</code> -&nbsp;<code>'9'</code>)表示。</li>
<li>字符(<code>'j'</code> - <code>'z'</code>)分别用(<code>'10#'</code>&nbsp;-&nbsp;<code>'26#'</code>)表示。&nbsp;</li>
</ul>
<p>返回映射之后形成的新字符串。</p>
<p>题目数据保证映射始终唯一。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>s = "10#11#12"
<strong>输出:</strong>"jkab"
<strong>解释:</strong>"j" -&gt; "10#" , "k" -&gt; "11#" , "a" -&gt; "1" , "b" -&gt; "2".
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>s = "1326#"
<strong>输出:</strong>"acz"
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= s.length &lt;= 1000</code></li>
<li><code>s[i]</code> 只包含数字(<code>'0'</code>-<code>'9'</code>)和&nbsp;<code>'#'</code>&nbsp;字符。</li>
<li><code>s</code>&nbsp;是映射始终存在的有效字符串。</li>
</ul>