1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
//! # Day 12: Digital Plumber
//!
//! Walking along the memory banks of the stream, you find a small village that is experiencing a
//! little confusion: some programs can't communicate with each other.
//!
//! Programs in this village communicate using a fixed system of **pipes**. Messages are passed
//! between programs using these pipes, but most programs aren't connected to each other directly.
//! Instead, programs pass messages between each other until the message reaches the intended
//! recipient.
//!
//! For some reason, though, some of these messages aren't ever reaching their intended recipient,
//! and the programs suspect that some pipes are missing. They would like you to investigate.
//!
//! You walk through the village and record the ID of each program and the IDs with which it can
//! communicate directly (your puzzle input). Each program has one or more programs with which it
//! can communicate, and these pipes are bidirectional; if `8` says it can communicate with `11`,
//! then `11` will say it can communicate with `8`.
//!
//! You need to figure out how many programs are in the group that contains program ID `0`.
//!
//! For example, suppose you go door-to-door like a travelling salesman and record the following
//! list:
//!
//! ```txt
//! 0 <-> 2
//! 1 <-> 1
//! 2 <-> 0, 3, 4
//! 3 <-> 2, 4
//! 4 <-> 2, 3, 6
//! 5 <-> 6
//! 6 <-> 4, 5
//! ```
//!
//! In this example, the following programs are in the group that contains program ID `0`:
//!
//! - Program `0` by definition.
//! - Program `2`, directly connected to program `0`.
//! - Program `3` via program `2`.
//! - Program `4` via program `2`.
//! - Program `5` via programs `6`, then `4`, then `2`.
//! - Program `6` via programs `4`, then `2`.
//!
//! Therefore, a total of `6` programs are in this group; all but program `1`, which has a pipe that
//! connects it to itself.
//!
//! **How many programs** are in the group that contains program ID `0`?
use anyhow::Result;
pub const INPUT: &str = include_str!("d12.txt");
pub fn solve_part_one(input: &str) -> Result<i64> {
Ok(0)
}
pub fn solve_part_two(input: &str) -> Result<i64> {
Ok(0)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn part_one() {}
#[test]
fn part_two() {}
}