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);