wait a minute

main
Yanick Champoux 2023-01-02 11:02:06 -05:00
parent 231cc7b883
commit 9adefbc796
1 changed files with 16 additions and 3 deletions

View File

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