Skip to content

Commit 247e0ca

Browse files
committed
refactor
1 parent b57e06f commit 247e0ca

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/2025/day02.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ function invalidSum(input, regex) {
33
let sum = 0;
44
for (let range of ranges) {
55
for (let i = range[0]; i <= range[1]; i++) {
6-
let str = i.toString();
7-
if (str.match(regex)) {
8-
sum += i;
9-
}
6+
if (`${i}`.match(regex)) sum += i;
107
}
118
}
129
return sum;

0 commit comments

Comments
 (0)