We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b57e06f commit 247e0caCopy full SHA for 247e0ca
src/2025/day02.js
@@ -3,10 +3,7 @@ function invalidSum(input, regex) {
3
let sum = 0;
4
for (let range of ranges) {
5
for (let i = range[0]; i <= range[1]; i++) {
6
- let str = i.toString();
7
- if (str.match(regex)) {
8
- sum += i;
9
- }
+ if (`${i}`.match(regex)) sum += i;
10
}
11
12
return sum;
0 commit comments