From 411784f4386ca4aeaac741c3e3630012e731e542 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 24 Jan 2024 22:50:25 +0100 Subject: [PATCH] prepare expanding sequences by duplicating last value --- src/day09/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/day09/mod.rs b/src/day09/mod.rs index 99aadc0..3f11394 100644 --- a/src/day09/mod.rs +++ b/src/day09/mod.rs @@ -22,6 +22,16 @@ pub fn main() { } } +fn expand(strct: &mut Vec>) { + let last = strct + .last_mut() + .unwrap(); + last.push(*last + .last() + .unwrap() + ); +} + fn extra_diff(seq: Vec) -> Vec> { let mut structure = vec![seq]; let mut index = 0;