Skip to main content
Decode Ways | AlgoCracked
AlgoCracked
ProblemsDecode Ways
Medium34.0% acceptance
Blind75Dynamic ProgrammingString

Decode Ways

A message of digits is encoded with the mapping A → 1 , B → 2 , …, Z → 26 . Given a digit string s , return the number of ways to decode it. A 0 never stands alone (there is no letter for it), and a two-digit chunk is only a valid letter when it is between 10 and 26 . Input format Input is [s] , e.g. [ 226 ] .

Loading workspace…