MediumDynamic Programming
Decode Ways
Number of ways to decode string
Solution Approach
DP with previous states
Complexity Analysis
Time Complexity
O(n)Space Complexity
O(1)Complexity
Time:O(n)
Space:O(1)
Asked at
GoogleAmazon
Number of ways to decode string
DP with previous states
Time Complexity
O(n)Space Complexity
O(1)