package
0.0.0-20240717210230-cb72c3092e0b
Repository: https://github.com/ashinzekene/algorithms.git
Documentation: pkg.go.dev
# README
Decode Variations
Source: pramp
A letter can be encoded to a number in the following way:
'A' -> '1', 'B' -> '2', 'C' -> '3', ..., 'Z' -> '26'
A message is a string of uppercase letters, and it is encoded first using this scheme. For example, 'AZB' -> '1262'
Given a string of digits S from 0-9 representing an encoded message, return the number of ways to decode it.
Examples:
input: S = '1262'
output: 3
explanation: There are 3 messages that encode to '1262': 'AZB', 'ABFB', and 'LFB'.
Constraints:
[time limit] 5000ms
[input] string S
1 ≤ S.length ≤ 12
[output] integer