diff --git a/2022/src/bin/day4.rs b/2022/src/bin/day4.rs index 5da9587..a1d2304 100644 --- a/2022/src/bin/day4.rs +++ b/2022/src/bin/day4.rs @@ -75,8 +75,7 @@ fn overlaps((a, b): &(Elf, Elf)) -> bool { // Transform from line to pair of Elfs fn transform(s: &str) -> (Elf, Elf) { let transformed = s - .replace("-", ",") - .split(',') + .split([',', '-']) .flat_map(|value| value.parse::()) .collect::>();