clarify some comments

This commit is contained in:
2024-12-04 22:25:35 -05:00
parent 06f3e2411d
commit 172adce0ba

View File

@@ -16,7 +16,7 @@ console.log(
.slice(0, -1)
.reduce((coll, curr, index, array) => {
// 2D string matching is a pain. Let's turn it into a 1D problem!
// create the down rows
// create the columns
curr.split("").forEach((s, i) => {
coll[i] = coll[i] ? coll[i] + s : s;
});
@@ -34,7 +34,7 @@ console.log(
? coll[array.length * 4 + index - i - 2] + s
: s;
});
// include the original crosses
// include the original row
return [...coll, curr];
}, Array.from({ length: test ? 10 + (10 * 4 - 2) : 140 + 140 * 4 - 2 }) as string[])
.reduce((total, curr) => {