aoc/year2025/
day07.rs

1//! # Laboratories
2type Input = (u64, u64);
3
4pub fn parse(input: &str) -> Input {
5    let lines: Vec<_> = input.lines().map(str::as_bytes).collect();
6    let width = lines[0].len();
7    let center = width / 2;
8
9    let mut splits = 0;
10    let mut timelines = vec![0; width];
11    timelines[center] = 1;
12
13    for (y, row) in lines.iter().skip(2).step_by(2).enumerate() {
14        for x in ((center - y)..(center + y + 1)).step_by(2) {
15            let count = timelines[x];
16
17            if count > 0 && row[x] == b'^' {
18                splits += 1;
19                timelines[x] = 0;
20                timelines[x - 1] += count;
21                timelines[x + 1] += count;
22            }
23        }
24    }
25
26    (splits, timelines.iter().sum())
27}
28
29pub fn part1(input: &Input) -> u64 {
30    input.0
31}
32
33pub fn part2(input: &Input) -> u64 {
34    input.1
35}