Skip to content

Commit fa8fa00

Browse files
togo26dahyeong-yun
andauthored
Update decode-ways/togo26.js
Remove redundant code range validation Co-authored-by: polymorph <33543196+dahyeong-yun@users.noreply.github.com>
1 parent fc6f67f commit fa8fa00

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

decode-ways/togo26.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,9 @@ var numDecodings = function (s) {
5858

5959
let ways = 0;
6060

61-
if (codeMap[firstDigit]) {
62-
ways += go(start + 1);
63-
}
64-
61+
ways += go(start + 1);
6562
const twoDigits = firstDigit + secondDigit;
66-
if (Number(twoDigits) <= 26 && codeMap[twoDigits]) {
63+
if (Number(twoDigits) <= 26) {
6764
ways += go(start + 2);
6865
}
6966

0 commit comments

Comments
 (0)