Skip to content

Commit c6f8f74

Browse files
committed
simplify
1 parent c04e766 commit c6f8f74

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/day24/solution.gleam

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,7 @@ fn get_number(wires: Dict(String, Int), prefix: String) -> Int {
197197

198198
fn find_gates_with_input(gates: List(Gate), input: String) -> List(Gate) {
199199
gates
200-
|> list.filter(fn(g) {
201-
case g.input1, g.input2 {
202-
w, _ if w == input -> True
203-
_, w if w == input -> True
204-
_, _ -> False
205-
}
206-
})
200+
|> list.filter(fn(g) { g.input1 == input || g.input2 == input })
207201
}
208202

209203
fn has_or_gates(gates: List(Gate)) -> Bool {

0 commit comments

Comments
 (0)