This commit is contained in:
2025-12-02 21:35:09 -08:00
parent 47f7068705
commit f89bbf2bff
5 changed files with 12 additions and 14 deletions

View File

@@ -1,11 +1,6 @@
use std::collections::HashMap;
use aoc_runner_derive::{aoc, aoc_generator};
use lazy_static::lazy_static;
use memoize::memoize;
type Bank = [u8];
#[aoc_generator(day3)]
fn parse(input: &str) -> Vec<Vec<u8>> {
input
@@ -40,12 +35,12 @@ fn max_joltage(bank: Vec<u8>, n: usize) -> u64 {
}
#[aoc(day3, part1)]
fn part1(input: &Vec<Vec<u8>>) -> u64 {
fn part1(input: &[Vec<u8>]) -> u64 {
input.iter().map(|bank| max_joltage(bank.clone(), 2)).sum()
}
#[aoc(day3, part2)]
fn part2(input: &Vec<Vec<u8>>) -> u64 {
fn part2(input: &[Vec<u8>]) -> u64 {
input.iter().map(|bank| max_joltage(bank.clone(), 12)).sum()
}