2022-19 in js
This commit is contained in:
parent
ece85a2e99
commit
3430a7074b
11 changed files with 358 additions and 32 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue