Back to problems

Decode Ways

Algorithm · Tesla · Medium

Problem: Ways to Decode a Digit String Letters from A through Z are represented by the numbers 1 through 26: 'A' becomes "1" 'B' becomes "2" ... 'Z' becomes "26" You receive a string s made entirely of digits. Determine how many distinct valid letter sequences it can represent. Input Format Read one line containing the digit string s. Output Format Output a single integer representing the number of possible decodings. Constraints 1 <= len(s) <= 100 Every character in s is…

Checking your access…