diff --git a/nine/src/bruteforce.js b/nine/src/bruteforce.js index 5a59543..612caab 100644 --- a/nine/src/bruteforce.js +++ b/nine/src/bruteforce.js @@ -79,7 +79,9 @@ const checksum = iter => { .reduce(add) } -const expand3 = x => x.split('').map(toInt).map((x, i) => ([x, i % 2, i % 2 ? -1 : i / 2])) +const expand2 = x => x.split('') + .map(toInt) + .map((x, i) => ([x, i % 2, i % 2 ? -1 : i / 2])) const defrag2 = blocks => { const len = blocks.length - 1 @@ -120,5 +122,5 @@ const checksum2 = blocks => { } const part1 = pipe(expand, enfrag, checksum) -const part3 = pipe(expand3, defrag2, checksum2) +const part2 = pipe(expand2, defrag2, checksum2)