Loading problem…
A message is encoded by mapping A -> 1, B -> 2, ..., Z -> 26. You need to count how many valid ways a numeric string can be decoded.
A -> 1
B -> 2
Z -> 26
Given a string s containing only digits, return the number of possible decodings.
s
numDecodings('12'); // 2 -> 'AB', 'L' numDecodings('226'); // 3 -> 'BBF', 'BZ', 'VF' numDecodings('06'); // 0
3 hints available with Pro