Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5e320c3

Browse files
committed
add 06
1 parent 0653466 commit 5e320c3

File tree

1 file changed

+23
-0
lines changed
  • leetcode刷题/note/6月刷题

1 file changed

+23
-0
lines changed

leetcode刷题/note/6月刷题/06.MD

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# 面试题 46. 把数字翻译成字符串
2+
3+
给定一个数字,我们按照如下规则把它翻译为字符串:0 翻译成 “a” ,1 翻译成 “b”,……,11 翻译成 “l”,……,25 翻译成 “z”。一个数字可能有多个翻译。请编程实现一个函数,用来计算一个数字有多少种不同的翻译方法。
4+
5+
难度:`middle`
6+
7+
## 示例
8+
9+
```
10+
示例 1:
11+
12+
输入: 12258
13+
输出: 5
14+
解释: 12258有5种不同的翻译,分别是"bccfi", "bwfi", "bczi", "mcfi"和"mzi"
15+
```
16+
17+
### 解题思路
18+
19+
这道题和青蛙跳台阶差不多,只不过需要加上一个限制条件。
20+
21+
使用动态规划的思路.
22+
23+
![](https://mayandev.oss-cn-hangzhou.aliyuncs.com/blog/WX20200609-231832@2x.png)

0 commit comments

Comments
 (0)