From 9adefbc7962c0d1a863a0ce7120f4f446ea63a31 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Mon, 2 Jan 2023 11:02:06 -0500 Subject: [PATCH] wait a minute --- 2022/16/part2.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/2022/16/part2.js b/2022/16/part2.js index 5f70916..441d100 100644 --- a/2022/16/part2.js +++ b/2022/16/part2.js @@ -1,13 +1,26 @@ import { bidirectional } from 'graphology-shortest-path'; import * as R from "remeda"; +import u from 'updeep'; import { buildGraph } from './part1.js'; -function finalSteam(tunnels, graph, minutesLeft, possibilities, locations, activeSteam = 0) { - +const findMaxSteam = (tunnels,graph) => (minutesLeft, unopened, opened, activeSteam, peeps ) => { if (minutesLeft <= 0) return 0; - if (possibilities.length === 0) return minutesLeft * activeSteam; + if (unopened.length === 0) return minutesLeft * activeSteam; + + const next = R.first( R.sortBy(peeps, R.prop('eta'))); + + if( next.eta >) + + + + +} + +function finalSteam(tunnels, graph, minutesLeft, possibilities, locations, activeSteam = 0) { + + const nextToGo = locations.filter(([time]) => !time);