Skip to content

Commit 5c89c41

Browse files
committed
minor fix
1 parent e128e93 commit 5c89c41

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/2024/day24.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,16 @@ function extractUnit(gates, i) {
5050
let not = gates
5151
.filter(x => x.a === `x${next}` && x.b === `y${next}`)
5252
.map(x => x.wire);
53-
let wires = unit.map(x => x.wire);
5453
let done = false;
5554
while (!done) {
5655
done = true;
56+
let wires = unit.map(x => x.wire);
5757
let more = gates.filter(x => wires.includes(x.a) || wires.includes(x.b));
5858
more = more.filter(x => !unit.includes(x));
5959
more = more.filter(x => !not.includes(x.a) && !not.includes(x.b));
6060
if (more.length) {
6161
done = false;
6262
unit.push(...more);
63-
wires.push(...more.map(x => x.wire));
6463
}
6564
}
6665
return unit;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy