Skip to content

Commit 66f1107

Browse files
committed
fix indentation issues
1 parent 57995e0 commit 66f1107

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

dynamic_programming/decode_ways.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,23 @@
1010
'''
1111

1212
def num_decodings(s: str):
13-
'''
13+
"""
1414
>> num_decodings("12")
1515
2
1616
>> num_decodings("226")
1717
3
18-
'''
18+
"""
1919
if not s or int(s[0]) == 0:
2020
return 0
2121

2222
last = 1
2323
second_last = 1
24-
24+
2525
for i in range(1, len(s)):
26-
2726
# 0 is a special digit since it does not
2827
# correspond to any alphabet but can be
2928
# meaningful if preceeded by 1 or 2
30-
29+
3130
if s[i] == "0":
3231
if s[i-1] in {"1", "2"}:
3332
curr = second_last
@@ -47,4 +46,4 @@ def num_decodings(s: str):
4746
if __name__ == "__main__":
4847
import doctest
4948

50-
doctest.testmod()
49+
doctest.testmod()

0 commit comments

Comments
 (0)