mirror of
https://github.com/Rhelvetican/aoc2024.git
synced 2024-12-23 06:51:40 +00:00
day 3.1
This commit is contained in:
parent
b250c12230
commit
7e01b4fb9c
1 changed files with 3 additions and 3 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue