From 72b3ecfcbe085da520a9c24717c517a912cf8a53 Mon Sep 17 00:00:00 2001 From: kitsunecafe Date: Sat, 14 Dec 2024 15:17:47 -0600 Subject: [PATCH] cleanup --- nine/src/bruteforce.js | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/nine/src/bruteforce.js b/nine/src/bruteforce.js index f28f7c7..5a59543 100644 --- a/nine/src/bruteforce.js +++ b/nine/src/bruteforce.js @@ -1,6 +1,3 @@ -import { readFile } from 'node:fs/promises' -import { resolve } from 'node:path' - const pipe = (...fns) => x => fns.reduce((val, fn) => fn(val), x) const add = (a, b) => a + b const mul = (a, b) => a * b @@ -125,24 +122,3 @@ const checksum2 = blocks => { const part1 = pipe(expand, enfrag, checksum) const part3 = pipe(expand3, defrag2, checksum2) -//const tests = [ -// ['1313165', 169], -// ['12345', 132], -// ['54321', 31], -// ['2333133121414131402', 2858], -// ['1010101010101010101010', 385], -// ['111111111111111111111', 290], -// ['10101010101010101010101', 506], -// ['90909', 513] -//] -// -//tests.forEach(([input, expected], i) => { -// //console.log(`input length is ${input.length}`) -// const result = part3(input) -// console.log(i, result === expected, result) -//}) - -readFile(resolve('./input'), { encoding: 'utf8' }) - .then(part3) - .then(console.log) -