From 2f9adec8ff0c9ede01384497c41bd6f2212f3708 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Mon, 17 Jan 2022 17:46:42 +0100 Subject: [PATCH] 2021 day12/rust: fix solution --- 2021/day12/day12_rs/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2021/day12/day12_rs/src/main.rs b/2021/day12/day12_rs/src/main.rs index 5a92c54..f4e81aa 100644 --- a/2021/day12/day12_rs/src/main.rs +++ b/2021/day12/day12_rs/src/main.rs @@ -45,10 +45,10 @@ fn main() { let p1 = parts.next().unwrap(); let p2 = parts.next().unwrap(); - if p2 != "start" { + if p1 != "end" && p2 != "start" { map.entry(p1).or_default().insert(p2); } - if p2 != "end" { + if p2 != "end" && p1 != "start" { map.entry(p2).or_default().insert(p1); } map