GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing leetcode.cn — 91. 解码方法 - 力扣(LeetCode) 题目描述 题目描述 题解 题解 提交记录 提交记录 中等 一条包含字母
然而,在 解码 已编码的消息时,你意识到有许多不同的方式来解码,因为有些编码被包含在其它编码当中( 例如,
注意,可能存在无法解码的字符串。 给你一个只含数字的 非空 字符串 题目数据保证答案肯定是一个 32 位 的整数。
示例 1: 输入:s = "12" 输出:2 解释:它可以解码为 "AB"(1 2)或者 "L"(12)。 示例 2: 输入:s = "226" 输出:3 解释:它可以解码为 "BZ" (2 26), "VF" (22 6), 或者 "BBF" (2 2 6) 。 示例 3: 输入:s = "06" 输出:0 解释:"06" 无法映射到 "F" ,因为存在前导零("6" 和 "06" 并不等价)。
提示:
代码 代码 测试用例 测试用例 测试结果 测试结果 |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |