剑指 Offer 46. 把数字翻译成字符串bahttps://leetcode.cn/problems/ba-shu-zi-fan-yi-cheng-zi-fu-chuan-lcof/
| 2023-9-23
0  |  阅读时长 0 分钟
Date
Mar 30, 2023
need_review
need_review
type
剑指 Offer(第 2 版)
undo
undo
难度
中等
给定一个数字,我们按照如下规则把它翻译为字符串:0 翻译成 “a” ,1 翻译成 “b”,……,11 翻译成 “l”,……,25 翻译成 “z”。一个数字可能有多个翻译。请编程实现一个函数,用来计算一个数字有多少种不同的翻译方法。
示例 1:
提示:
  • 0 <= num < 2^31
 
  • Giscus
目录