This commit is contained in:
ktims committed 2025-12-02 21:36:29 -08:00
1 parent 47f7068705
commit f89bbf2bff
5 files changed
+12 -14

No files matched your search

+2 -7
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()
}