Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Decode Ways
Bookmark
Input
Example 1
Example 2 (zero inside)
Example 3 (dead end)
Starts with 0
Custom
s
=
1226
s =
"1226"
1=A, 2=B, ... 26=Z
1
2
2
6
digits
dp
0
0
0
1
0
2
0
3
0
4
each digit or digit pair (1..26) becomes a letter: how many readings of "1226"?
algo
master
.
io
Step:
How many ways can "1226" be decoded back into letters?
0 / 17
Input
Example 1
Example 2 (zero inside)
Example 3 (dead end)
Starts with 0
Custom
s
=
1226
0 / 17
s =
"1226"
1=A, 2=B, ... 26=Z
1
2
2
6
digits
dp
0
0
0
1
0
2
0
3
0
4
each digit or digit pair (1..26) becomes a letter: how many readings of "1226"?
algo
master
.
io
Step:
How many ways can "1226" be decoded back into letters?