We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5af9349 commit ba45291Copy full SHA for ba45291
src/solutions/year2025/day05.rs
@@ -14,8 +14,15 @@ impl Solution for Day05 {
14
.to_string()
15
}
16
17
- fn part_two(&self, _input: &str) -> String {
18
- String::from("0")
+ fn part_two(&self, input: &str) -> String {
+ let (ranges, _) = self.parse(input);
19
+
20
+ ranges
21
+ .iter()
22
+ .flat_map(|range| range.clone())
23
+ .unique()
24
+ .count()
25
+ .to_string()
26
27
28
@@ -65,4 +72,9 @@ mod tests {
65
72
fn part_one_example_test() {
66
73
assert_eq!("3", Day05.part_one(EXAMPLE));
67
74
75
76
+ #[test]
77
+ fn part_two_example_test() {
78
+ assert_eq!("14", Day05.part_two(EXAMPLE));
79
+ }
68
80
0 commit comments