1
0
Fork 0

porting over AOC from previous years to a monorepo.

This commit is contained in:
Gabe Venberg 2026-04-16 14:45:29 +02:00
commit 84c4cf9991
194 changed files with 30104 additions and 0 deletions

20
2023/days/09/src/part1.rs Normal file
View file

@ -0,0 +1,20 @@
use crate::parse::*;
pub fn part1(input: &[Vec<i32>]) -> i32 {
input.iter().map(|l| extrapolate_sequence(l)).sum()
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_part1() {
let input = vec![
vec![0, 3, 6, 9, 12, 15],
vec![1, 3, 6, 10, 15, 21],
vec![10, 13, 16, 21, 30, 45],
];
assert_eq!(part1(&input), 114);
}
}