2022-19 in js

This commit is contained in:
Julien Dessaux 2022-12-28 20:03:29 +01:00
parent ece85a2e99
commit 3430a7074b
Signed by: adyxax
GPG key ID: F92E51B86E07177E
11 changed files with 358 additions and 32 deletions

View file

@ -18,8 +18,7 @@ fs.readFileSync("input", "utf8")
rate: a[2],
computePathCostTo: function (target) {
Object.values(valves).forEach(v => v.cost = 0);
let nq = new PriorityQueue();
nq.enqueue(this, 0);
let nq = new PriorityQueue(this);
while (true) {
let n = nq.dequeue();
if (n.element.label === target) {