91 Decode Ways
91. Decode Ways
1. Question
A message containing letters fromA-Z
is being encoded to numbers using the following mapping:
Given a non-empty string containing only digits, determine the total number of ways to decode it.
Example 1:
Example 2:
2. Implementation
(1) DP
3. Time & Space Complexity
时间复杂度O(n), 空间复杂度O(n)
Last updated
Was this helpful?