2021 day12/rust: fix solution

This commit is contained in:
Xiretza 2022-01-17 17:46:42 +01:00
parent 0220f88e27
commit 2f9adec8ff

View file

@ -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