1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/把数字翻译成字符串 [ba-shu-zi-fan-yi-cheng-zi-fu-chuan-lcof].html
2022-03-29 12:43:11 +08:00

18 lines
771 B
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>给定一个数字我们按照如下规则把它翻译为字符串0 翻译成 &ldquo;a&rdquo; 1 翻译成 &ldquo;b&rdquo;&hellip;&hellip;11 翻译成 &ldquo;l&rdquo;&hellip;&hellip;25 翻译成 &ldquo;z&rdquo;。一个数字可能有多个翻译。请编程实现一个函数,用来计算一个数字有多少种不同的翻译方法。</p>
<p>&nbsp;</p>
<p><strong>示例 1:</strong></p>
<pre><strong>输入:</strong> 12258
<strong>输出:</strong> <code>5
</code><strong>解释:</strong> 12258有5种不同的翻译分别是&quot;bccfi&quot;, &quot;bwfi&quot;, &quot;bczi&quot;, &quot;mcfi&quot;&quot;mzi&quot;</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 &lt;= num &lt; 2<sup>31</sup></code></li>
</ul>