This commit is contained in:
Rh4096 2024-12-03 18:13:40 +07:00
parent b250c12230
commit 7e01b4fb9c

View file

@ -10,9 +10,6 @@ static MUL: LazyLock<Regex> =
static COND_MUL: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"(mul\([0-9]{1,3},[0-9]{1,3}\))|(do\(\))|(don't\(\))").unwrap());
#[derive(Clone, Copy)]
pub struct AocDayThreeSolution;
fn as_mul(s: &str) -> u64 {
let (a, b) = s[4..(s.len() - 1)]
.split_once(',')
@ -22,6 +19,9 @@ fn as_mul(s: &str) -> u64 {
a * b
}
#[derive(Clone, Copy)]
pub struct AocDayThreeSolution;
impl AocSolution for AocDayThreeSolution {
type Output = u64;
const INPUT: &str = include_str!("../../input/day3.txt");